Part Number Hot Search : 
C4046 HERF803 NJM2868F STK1820F STA51 EL2041J 95J4K5E MJE243
Product Description
Full Text Search
 

To Download UPD780208GF-XXX-3BA Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  pd780208 subseries 8-bit single-chip microcontrollers pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208 document no. u11302ej4v0um00 (4th edition) date published july 2003 n cp(k) printed in japan user? manual c
2 user? manual u11302ej4v0um [memo]
3 user? manual u11302ej4v0um fip and iebus are trademarks of nec electronics corporation. ms-dos, windows, and windows nt are either registered trademarks or trademarks of microsoft corporation in the united states and/or other countries. ibm dos, pc/at, and pc dos are trademarks of international business machines corporation. hp9000 series 700 and hp-ux are trademarks of hewlett-packard company. sparcstation is a trademark of sparc international, inc. solaris and sunos are trademarks of sun microsystems, inc. tron stands for the realtime operating system nucleus. itron is an abbreviation of industrial tron. notes for cmos devices 1 precaution against esd for semiconductors note: strong electric field, when exposed to a mos device, can cause destruction of the gate oxide and ultimately degrade the device operation. steps must be taken to stop generation of static electricity as much as possible, and quickly dissipate it once, when it has occurred. environmental control must be adequate. when it is dry, humidifier should be used. it is recommended to avoid using insulators that easily build static electricity. semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. all test and measurement tools including work bench and floor should be grounded. the operator should be grounded using wrist strap. semiconductor devices must not be touched with bare hands. similar precautions need to be taken for pw boards with semiconductor devices on it. 2 handling of unused input pins for cmos note: no connection for cmos device inputs can be cause of malfunction. if no connection is provided to the input pins, it is possible that an internal input level may be generated due to noise, etc., hence causing malfunction. cmos devices behave differently than bipolar or nmos devices. input levels of cmos devices must be fixed high or low by using a pull-up or pull-down circuitry. each unused pin should be connected to v dd or gnd with a resistor, if it is considered to have a possibility of being an output pin. all handling related to the unused pins must be judged device by device and related specifications governing the devices. 3 status before initialization of mos devices note: power-on does not necessarily define initial status of mos device. production process of mos does not define the initial operation status of the device. immediately after the power source is turned on, the devices with reset function have not yet been initialized. hence, power-on does not guarantee out-pin levels, i/o settings or contents of registers. device is not initialized until the reset signal is received. reset operation must be executed immediately after power-on for devices having reset function.
4 user s manual u11302ej4v0um the information in this document is current as of january, 2003. the information is subject to change without notice. for actual design-in, refer to the latest publications of nec electronics data sheets or data books, etc., for the most up-to-date specifications of nec electronics products. not all products and/or types are available in every country. please check with an nec electronics sales representative for availability and additional information. no part of this document may be copied or reproduced in any form or by any means without the prior written consent of nec electronics. nec electronics assumes no responsibility for any errors that may appear in this document. nec electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of nec electronics products listed in this document or any other liability arising from the use of such products. no license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of nec electronics or others. descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. the incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. nec electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. while nec electronics endeavors to enhance the quality, reliability and safety of nec electronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. to minimize risks of damage to property or injury (including death) to persons arising from defects in nec electronics products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and anti-failure features. nec electronics products are classified into the following three quality grades: "standard", "special" and "specific". the "specific" quality grade applies only to nec electronics products developed based on a customer- designated "quality assurance program" for a specific application. the recommended applications of an nec electronics product depend on its quality grade, as indicated below. customers must check the quality grade of each nec electronics product before using it in a particular application. "standard": computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. "special": transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support). "specific": aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. the quality grade of nec e lectronics products is "standard" unless otherwise expressly specified in nec electronics data sheets or data books, etc. if customers wish to use nec electronics products in applications not intended by nec electronics, they must contact an nec electronics sales representative in advance to determine nec electronics' willingness to support a given application. (note) (1) "nec electronics" as used in this statement means nec electronics corporation and also includes its majority-owned subsidiaries. (2) "nec electronics products" means any product developed or manufactured by or for nec electronics (as defined above). ? ? ? ? ? ? m8e 02. 11-1 these commodities, technology or software, must be exported in accordance with the export administration regulations of the exporting country. diversion contrary to the law of that country is prohibited.
5 user s manual u11302ej4v0um regional information ? device availability ? ordering information ? product release schedule ? availability of related technical literature ? development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, ac supply voltages, and so forth) ? network requirements in addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. [global support] http://www.necel.com/en/support/support.html nec electronics america, inc. (u.s.) santa clara, california tel: 408-588-6000 800-366-9782 nec electronics hong kong ltd. hong kong tel: 2886-9318 nec electronics hong kong ltd. seoul branch seoul, korea tel: 02-558-3737 nec electronics shanghai, ltd. shanghai, p.r. china tel: 021-6841-1138 nec electronics taiwan ltd. taipei, taiwan tel: 02-2719-2377 nec electronics singapore pte. ltd. novena square, singapore tel: 6253-8311 j03.4 n ec electronics (europe) gmbh duesseldorf, germany tel: 0211-65 03 01 sucursal en espa ? a madrid, spain tel: 091-504 27 87 v ? lizy-villacoublay, france tel: 01-30-67 58 00 succursale fran ? aise filiale italiana milano, italy tel: 02-66 75 41 branch the netherlands eindhoven, the netherlands tel: 040-244 58 45 tyskland filial taeby, sweden tel: 08-63 80 820 united kingdom branch milton keynes, uk tel: 01908-691-133 some information contained in this document may vary from country to country. before using any nec electronics product in your application, piease contact the nec electronics office in your country to obtain a list of authorized representatives and distributors. they will verify:
6 user? manual u11302ej4v0um major revisions in this edition page description throughout addition of the following products to target products ? pd780204a ? pd780205a deletion of the following package from target products ? pd78p0208kl-t (100-pin ceramic wqfn) chapter 1 outline p.29 ?update of 1.6 78k/0 series lineup p.32 ?addition of note in 1.8 overview of functions p.33 ?addition of caution in table 1-1 mask options in mask rom versions chapter 2 pin functions p.42 ?addition of 2.2.12 v load p.43 ?modification of table 2-1 types of pin i/o circuits chapter 3 cpu architecture p.48 ?addition of caution in 3.1 memory space p.67 ?modification of note in table 3-3 special-function register list chapter 4 port functions p.90 ?addition of caution in 4.2.6 port 8 p.91 ?addition of caution in 4.2.7 port 9 p.92 ?addition of caution in 4.2.8 port 10 p.93 ?addition of caution in 4.2.9 port 11 p.94 ?addition of caution in 4.2.10 port 12 chapter 5 clock generator p.103 ?addition of note in figure 5-3 format of processor clock control register chapter 6 16-bit timer/event counter p.133 ?modification of caution in figure 6-8 format of external interrupt mode register p.144 ?modification of 6.6 (5) valid edge setting chapter 8 watch timer p.171 ?modification of caution in figure 8-2 format of timer clock select register 2 chapter 9 watchdog timer p.178 ?modification of caution in figure 9-2 format of timer clock select register 2 chapter 11 buzzer output controller p.188 ?modification of caution in figure 11-2 format of timer clock select register 2 chapter 16 interrupt and test functions p.340 ?addition of caution in figure 16-2 format of interrupt request flag register p.343 ?modification of caution in figure 16-5 format of external interrupt mode register chapter 17 standby function p.361 ?addition of description in table 17-1 halt mode operating status p.364 ?addition of description in table 17-3 stop mode operating status chapter 19 pd78p0208 p.373 ?modification of table 19-2 internal memory size switching register setting values appendix a differences between pd78044h, 780228, and 780208 subseries p.398 ?modification of description in table a-1 major differences between pd78044h, 780228, and 780208 subseries appendix b development tools p.399 ?modification of description the mark shows major revised points.
7 user? manual u11302ej4v0um introduction readers this manual has been prepared for user engineers who wish to understand the functions of the pd780208 subseries and design and develop its application systems and programs. purpose this manual is intended to give users an understanding of the functions described in the organization below. organization the pd780208 subseries manual consists of two parts: this manual and instructions (common to the 78k/0 series) pd780208 subseries 78k/0 series user? manual instructions (this manual) user? manual ? pin functions ? cpu functions ? internal block functions ? instruction set ? interrupts ? explanation of each instruction ? other on-chip peripheral functions how to read this manual it is assumed that the reader of this manual has general knowledge in the fields of electrical engineering, logic circuits, and microcontrollers. for an understanding of functions in general: read this manual in the order of the contents . for how to interpret the register format: for a bit number enclosed in angle brackets, the bit name is defined as a reserved word in the ra78k0, and is defined in the header file named sfrbit.h in the cc78k0. to confirm the details of a register whose register name is known: refer to appendix c register index . for the details of pd780208 subseries instruction functions: refer to 78k/0 series instructions user? manual (u12326e) . for the electrical specifications of the pd780208 subseries: refer to the separate pd780204, 780205, 780206, 780208 data sheet (u10436e) and pd78p0208 data sheet (u11295e) . for application examples of the pd780208 subseries: refer to the separate 78k/0 series basics (ii) application note (u10121e) . conventions data significance: higher digits on the left and lower digits on the right active low representation: xxx (overscore over pin or signal name) note : footnote for item marked with note in the text caution : information requiring particular attention remark : supplementary information numerical representation: binary .................. xxxx or xxxxb decimal ............... xxxx hexadecimal ....... xxxxh
8 user s manual u11302ej4v0um related documents the related documents indicated in this publication may include preliminary versions. however, preliminary versions are not marked as such. documents related to devices document name document no. pd780204, 780205, 780206, 780208 data sheet u10436e pd78p0208 data sheet u11295e pd780208 subseries user s manual this manual 78k/0 series instructions user s manual u12326e 78k/0 series basic (ii) application note u10121e documents related to software development tools (user? manuals) document name document no. ra78k0 assembler package operation u14445e language u14446e structured assembly language u11789e cc78k0 c compiler operation u14297e language u14298e sm78k series system simulator ver. 2.30 or later operation (windows tm based) u15373e external part user open interface specification u15802e id78k series integrated debugger ver. 2.30 or later operation (windows based) u15185e rx78k0 real-time os fundamentals u11537e installation u11536e project manager ver. 3.12 or later (windows based) u14610e documents related to hardware development tools (user? manuals) document name document no. ie-78k0-ns in-circuit emulator u13731e ie-78k0-ns-a in-circuit emulator u14889e ie-780208-ns-em1 emulation board u13691e ie-78001-r-a in-circuit emulator u14142e ie-780208-r-em emulation board eeu-1501 caution the related documents listed above are subject to change without notice. be sure to use the latest version of each document for designing.
9 user s manual u11302ej4v0um documents related to prom writing (user? manuals) document name document no. pg-1500 prom programmer u11940e pg-1500 controller pc-9800 series (ms-dos tm based) eeu-1291 ibm pc series (pc dos tm based) u10540e other related documents document name document no. semiconductor selection guide - products and packages - x13769x semiconductor device mount manual note quality grades on nec semiconductor devices c11531e nec semiconductor device reliability/quality control system c10983e guide to prevent damage for semiconductor devices by electrostatic discharge (esd) c11892e note see the semiconductor device mount manual website (http://www.necel.com/pkg/en/mount/index.html). caution the related documents listed above are subject to change without notice. be sure to use the latest version of each document for designing.
10 user? manual u11302ej4v0um contents chapter 1 outline ............................................................................................................ ............. 24 1.1 features ............................................................................................................................... 24 1.2 applications ......................................................................................................................... 25 1.3 ordering information .......................................................................................................... 25 1.4 quality grade ...................................................................................................................... 25 1.5 pin configuration (top view) ............................................................................................ 26 1.6 78k/0 series lineup ........................................................................................................... 29 1.7 block diagram ..................................................................................................................... 31 1.8 overview of functions ....................................................................................................... 32 1.9 mask options ...................................................................................................................... 33 chapter 2 pin functions ....................................................................................................... ....... 34 2.1 pin function list ................................................................................................................. 34 2.1.1 normal operating mode pins .................................................................................................. 34 2.1.2 prom programming mode pins ( pd78p0208 only) ........................................................... 37 2.2 description of pin functions ............................................................................................ 38 2.2.1 p00 to p04 (port 0) ................................................................................................................. 38 2.2.2 p10 to p17 (port 1) ................................................................................................................. 38 2.2.3 p20 to p27 (port 2) ................................................................................................................. 39 2.2.4 p30 to p37 (port 3) ................................................................................................................. 39 2.2.5 p70 to p74 (port 7) ................................................................................................................. 40 2.2.6 p80 to p87 (port 8) ................................................................................................................. 40 2.2.7 p90 to p97 (port 9) ................................................................................................................. 40 2.2.8 p100 to p107 (port 10) ........................................................................................................... 41 2.2.9 p110 to p117 (port 11) ........................................................................................................... 41 2.2.10 p120 to p127 (port 12) ........................................................................................................... 41 2.2.11 fip0 to fip12 .......................................................................................................................... 41 2.2.12 v load ............................................................................................................................... ......... 42 2.2.13 av ref ............................................................................................................................... ........ 42 2.2.14 av dd ............................................................................................................................... .......... 42 2.2.15 av ss ............................................................................................................................... .......... 42 2.2.16 reset ............................................................................................................................... ...... 42 2.2.17 x1 and x2 ............................................................................................................................... .42 2.2.18 xt1 and xt2 ........................................................................................................................... 42 2.2.19 v dd ............................................................................................................................... ............ 42 2.2.20 v ss ............................................................................................................................... ............. 42 2.2.21 v pp ( pd78p0208 only) .......................................................................................................... 42 2.2.22 ic (mask rom version only) .................................................................................................. 42 2.3 pin i/o circuits and recommended connection of unused pins ............................... 43 chapter 3 cpu architecture ................................................................................................... .48 3.1 memory space ..................................................................................................................... 48 3.1.1 internal program memory space ............................................................................................ 53 3.1.2 internal data memory space ................................................................................................... 54 3.1.3 special-function register (sfr) area ...................................................................................... 54
11 user? manual u11302ej4v0um 3.1.4 data memory addressing ........................................................................................................ 55 3.2 processor registers ........................................................................................................... 60 3.2.1 control registers ...................................................................................................................... 60 3.2.2 general-purpose registers ...................................................................................................... 63 3.2.3 special-function registers (sfrs) ........................................................................................... 64 3.3 instruction address addressing ...................................................................................... 68 3.3.1 relative addressing ................................................................................................................. 68 3.3.2 immediate addressing ............................................................................................................. 69 3.3.3 table indirect addressing ........................................................................................................ 70 3.3.4 register addressing ................................................................................................................ 71 3.4 operand address addressing .......................................................................................... 72 3.4.1 implied addressing .................................................................................................................. 72 3.4.2 register addressing ................................................................................................................ 73 3.4.3 direct addressing .................................................................................................................... 74 3.4.4 short direct addressing ........................................................................................................... 75 3.4.5 special-function register (sfr) addressing ........................................................................... 76 3.4.6 register indirect addressing ................................................................................................... 77 3.4.7 based addressing .................................................................................................................... 78 3.4.8 based indexed addressing ..................................................................................................... 79 3.4.9 stack addressing ..................................................................................................................... 79 chapter 4 port functions ..................................................................................................... .... 80 4.1 port functions ..................................................................................................................... 80 4.2 port configuration .............................................................................................................. 83 4.2.1 port 0 ............................................................................................................................... ........ 83 4.2.2 port 1 ............................................................................................................................... ........ 85 4.2.3 port 2 ............................................................................................................................... ........ 86 4.2.4 port 3 ............................................................................................................................... ........ 88 4.2.5 port 7 ............................................................................................................................... ........ 89 4.2.6 port 8 ............................................................................................................................... ........ 90 4.2.7 port 9 ............................................................................................................................... ........ 91 4.2.8 port 10 ............................................................................................................................... ...... 92 4.2.9 port 11 ............................................................................................................................... ...... 93 4.2.10 port 12 ............................................................................................................................... ...... 94 4.3 port function control registers ...................................................................................... 95 4.4 port function operations .................................................................................................. 98 4.4.1 writing to i/o port .................................................................................................................... 98 4.4.2 reading from i/o port ............................................................................................................. 98 4.4.3 operations on i/o port ............................................................................................................ 98 4.5 selection of mask option .................................................................................................. 99 chapter 5 clock generator .................................................................................................... 100 5.1 clock generator functions ............................................................................................... 100 5.2 clock generator configuration ......................................................................................... 100 5.3 clock generator control registers .................................................................................. 102 5.4 system clock oscillator .................................................................................................... 109 5.4.1 main system clock oscillator ................................................................................................... 109 5.4.2 subsystem clock oscillator ..................................................................................................... 110
12 user? manual u11302ej4v0um 5.4.3 divider ............................................................................................................................... ....... 113 5.4.4 when subsystem clock is not used ........................................................................................ 113 5.5 clock generator operations ............................................................................................. 114 5.5.1 main system clock operations ................................................................................................ 115 5.5.2 subsystem clock operations ................................................................................................... 116 5.6 changing system clock and cpu clock settings ......................................................... 117 5.6.1 time required for switchover between system clock and cpu clock .................................. 117 5.6.2 system clock and cpu clock switching procedure ............................................................... 118 chapter 6 16-bit timer/event counter ................................................................................... 119 6.1 outline of timers incorporated in pd780208 subseries ............................................ 119 6.2 16-bit timer/event counter functions ............................................................................ 120 6.3 16-bit timer/event counter configuration ..................................................................... 122 6.4 16-bit timer/event counter control registers .............................................................. 127 6.5 16-bit timer/event counter operations .......................................................................... 135 6.5.1 interval timer operations ......................................................................................................... 135 6.5.2 pwm output operations .......................................................................................................... 137 6.5.3 pulse width measurement operations .................................................................................... 138 6.5.4 external event counter operation ........................................................................................... 140 6.5.5 square-wave output operation ............................................................................................... 142 6.6 16-bit timer/event counter operating precautions ...................................................... 143 chapter 7 8-bit timer/event counter .................................................................................... 145 7.1 8-bit timer/event counter functions .............................................................................. 145 7.1.1 8-bit timer/event counter mode ............................................................................................... 145 7.1.2 16-bit timer/event counter mode ............................................................................................ 148 7.2 8-bit timer/event counter configuration ....................................................................... 150 7.3 8-bit timer/event counter control registers ................................................................. 153 7.4 8-bit timer/event counter operations ............................................................................ 158 7.4.1 8-bit timer/event counter mode ............................................................................................... 158 7.4.2 16-bit timer/event counter mode ............................................................................................ 162 7.5 8-bit timer/event counter operating precautions ........................................................ 166 chapter 8 watch timer ........................................................................................................ ....... 168 8.1 watch timer functions ...................................................................................................... 168 8.2 watch timer configuration ............................................................................................... 169 8.3 watch timer control registers ........................................................................................ 169 8.4 watch timer operations .................................................................................................... 173 8.4.1 watch timer operation ............................................................................................................. 173 8.4.2 interval timer operation ........................................................................................................... 173 chapter 9 watchdog timer ..................................................................................................... .. 174 9.1 watchdog timer functions ............................................................................................... 174 9.2 watchdog timer configuration ........................................................................................ 175 9.3 watchdog timer control registers ................................................................................. 177 9.4 watchdog timer operations ............................................................................................. 180 9.4.1 watchdog timer operation ....................................................................................................... 180 9.4.2 interval timer operation ........................................................................................................... 181
13 user? manual u11302ej4v0um chapter 10 clock output controller ................................................................................. 182 10.1 clock output controller functions .................................................................................. 182 10.2 clock output controller configuration ........................................................................... 183 10.3 clock output function control registers ...................................................................... 183 chapter 11 buzzer output controller .............................................................................. 186 11.1 buzzer output controller functions ................................................................................ 186 11.2 buzzer output controller configuration ......................................................................... 186 11.3 buzzer output function control registers .................................................................... 187 chapter 12 a/d converter ..................................................................................................... .... 190 12.1 a/d converter functions ................................................................................................... 190 12.2 a/d converter configuration ............................................................................................ 190 12.3 a/d converter control registers ..................................................................................... 194 12.4 a/d converter operations ................................................................................................. 197 12.4.1 basic operations of a/d converter ......................................................................................... 197 12.4.2 input voltage and conversion results ..................................................................................... 199 12.4.3 a/d converter operating mode ............................................................................................... 200 12.5 a/d converter precautions ............................................................................................... 202 chapter 13 serial interface channel 0 ............................................................................... 205 13.1 functions of serial interface channel 0 .......................................................................... 206 13.2 configuration of serial interface channel 0 ................................................................... 207 13.3 control registers of serial interface channel 0 ............................................................ 211 13.4 operations of serial interface channel 0 ........................................................................ 217 13.4.1 operation stop mode .............................................................................................................. 217 13.4.2 3-wire serial i/o mode operation ............................................................................................ 218 13.4.3 sbi mode operation ................................................................................................................ 223 13.4.4 2-wire serial i/o mode operation ............................................................................................ 249 13.4.5 sck0/p27 pin output manipulation ........................................................................................ 255 chapter 14 serial interface channel 1 ............................................................................... 256 14.1 functions of serial interface channel 1 .......................................................................... 256 14.2 configuration of serial interface channel 1 ................................................................... 257 14.3 control registers of serial interface channel 1 ............................................................ 260 14.4 operations of serial interface channel 1 ........................................................................ 268 14.4.1 operation stop mode .............................................................................................................. 268 14.4.2 3-wire serial i/o mode operation ............................................................................................ 269 14.4.3 3-wire serial i/o mode operation with automatic transmit/receive function ......................... 272 chapter 15 vfd controller/driver ........................................................................................ 299 15.1 vfd controller/driver functions ...................................................................................... 299 15.2 vfd controller/driver configuration ............................................................................... 301 15.3 vfd controller/driver control registers ........................................................................ 303 15.3.1 control registers ...................................................................................................................... 303 15.3.2 one-display period and cut width ........................................................................................... 310 15.4 selecting display mode ..................................................................................................... 311 15.5 display mode and display output .................................................................................... 312 15.6 display data memory ......................................................................................................... 313
14 user? manual u11302ej4v0um 15.7 key scan flag and key scan data .................................................................................. 314 15.7.1 key scan flag ........................................................................................................................... 314 15.7.2 key scan data .......................................................................................................................... 314 15.8 light leakage of vfd ......................................................................................................... 315 15.9 display examples ............................................................................................................... 317 15.9.1 segment type (display mode 1: dspm05 = 0) ...................................................................... 318 15.9.2 dot type (display mode 1: dspm05 = 0) ............................................................................... 320 15.9.3 display type in which a segment spans two or more grids (display mode 2: dspm05 = 1) .............................................................................................. 322 15.10 calculating total power dissipation ............................................................................... 326 15.10.1 segment type (display mode 1: dspm05 = 0) ...................................................................... 326 15.10.2 dot type (display mode 1: dspm05 = 0) ............................................................................... 329 15.10.3 display type in which a segment spans two or more grids (display mode 2: dspm05 = 1) .............................................................................................. 332 chapter 16 interrupt and test functions .......................................................................... 335 16.1 interrupt function types ................................................................................................... 335 16.2 interrupt sources and configuration ............................................................................... 336 16.3 interrupt function control registers .............................................................................. 339 16.4 interrupt servicing operations ......................................................................................... 347 16.4.1 non-maskable interrupt request acknowledgment operation ................................................ 347 16.4.2 maskable interrupt request acknowledgment operation ........................................................ 350 16.4.3 software interrupt request acknowledgment operation ......................................................... 352 16.4.4 multiple interrupt servicing ...................................................................................................... 353 16.4.5 interrupt request hold .............................................................................................................. 356 16.5 test functions .................................................................................................................... 357 16.5.1 test function control registers ................................................................................................ 357 16.5.2 test input signal acknowledgment operation ........................................................................ 358 chapter 17 standby function ................................................................................................... 359 17.1 standby function and configuration .............................................................................. 359 17.1.1 standby function ...................................................................................................................... 359 17.1.2 standby function control register ............................................................................................ 360 17.2 standby function operations ........................................................................................... 361 17.2.1 halt mode ............................................................................................................................. 36 1 17.2.2 stop mode ............................................................................................................................. 36 4 chapter 18 reset function ..................................................................................................... ... 367 18.1 reset function .................................................................................................................... 367 chapter 19 pd78p0208 .................................................................................................................. 371 19.1 internal memory size switching register ....................................................................... 372 19.2 internal expansion ram size switching register ......................................................... 374 19.3 prom programming ........................................................................................................... 375 19.3.1 operating modes ..................................................................................................................... 375 19.3.2 prom write procedure ........................................................................................................... 377 19.3.3 prom read procedure ............................................................................................................ 381 19.4 screening of one-time prom version ........................................................................... 382
15 user? manual u11302ej4v0um chapter 20 instruction set .................................................................................................... ... 383 20.1 conventions ........................................................................................................................ 384 20.1.1 operand identifiers and description methods ........................................................................ 384 20.1.2 description of ?peration?column .......................................................................................... 385 20.1.3 description of ?lag operation?column ................................................................................... 385 20.2 operation list ...................................................................................................................... 386 20.3 instructions listed by addressing type ......................................................................... 394 appendix a differences between pd78044h, 780228, and 780208 subseries ............ 398 appendix b development tools .............................................................................................. 399 b.1 software package ............................................................................................................... 401 b.2 language processing software ........................................................................................ 401 b.3 control software ................................................................................................................. 402 b.4 prom programming tools ................................................................................................ 403 b.4.1 hardware ............................................................................................................................... .. 403 b.4.2 software ............................................................................................................................... .... 403 b.5 debugging tools (hardware) ............................................................................................ 404 b.5.1 when using in-circuit emulator ie-78k0-ns, ie-78k0-ns-a ................................................ 404 b.5.2 when using in-circuit emulator ie-78001-r-a ....................................................................... 405 b.6 debugging tools (software) ............................................................................................. 406 b.7 embedded software ........................................................................................................... 407 b.8 method for upgrading from former in-circuit emulator for 78k/0 series to ie-78001-r-a ........................................................................................................................ 408 b.9 conversion socket (ev-9200gf-100) package drawing and recommended footprint ............................................................................................................................... 409 b.10 notes on target system design ....................................................................................... 411 appendix c register index .................................................................................................... ..... 413 c.1 register index (by register name) .................................................................................. 413 c.2 register index (by register symbol) ............................................................................... 415 appendix d revision history ................................................................................................... .... 417
16 user? manual u11302ej4v0um list of figures (1/6) figure no. title page 2-1 pin i/o circuits ............................................................................................................................... .45 3-1 memory map ( pd780204 and pd780204a) .............................................................................. 48 3-2 memory map ( pd780205 and pd780205a) .............................................................................. 49 3-3 memory map ( pd780206) ............................................................................................................. 50 3-4 memory map ( pd780208) ............................................................................................................. 51 3-5 memory map ( pd78p0208) .......................................................................................................... 52 3-6 data memory addressing ( pd780204 and pd780204a) .......................................................... 55 3-7 data memory addressing ( pd780205 and pd780205a) .......................................................... 56 3-8 data memory addressing ( pd780206) ........................................................................................ 57 3-9 data memory addressing ( pd780208) ........................................................................................ 58 3-10 data memory addressing ( pd78p0208) ...................................................................................... 59 3-11 program counter format ................................................................................................................ 60 3-12 program status word format ......................................................................................................... 60 3-13 stack pointer format ...................................................................................................................... 61 3-14 data to be saved to stack memory ............................................................................................... 62 3-15 data to be reset from stack memory ........................................................................................... 62 3-16 general-purpose register configuration ....................................................................................... 63 4-1 port types ............................................................................................................................... ........ 80 4-2 block diagram of p00 and p04 ...................................................................................................... 84 4-3 block diagram of p01 to p03 ......................................................................................................... 84 4-4 block diagram of p10 to p17 ......................................................................................................... 85 4-5 block diagram of p20, p21, p23 to p26 ........................................................................................ 86 4-6 block diagram of p22 and p27 ...................................................................................................... 87 4-7 block diagram of p30 to p37 ......................................................................................................... 88 4-8 block diagram of p70 to p74 ......................................................................................................... 89 4-9 block diagram of p80 to p87 ......................................................................................................... 90 4-10 block diagram of p90 to p97 ......................................................................................................... 91 4-11 block diagram of p100 to p107 ..................................................................................................... 92 4-12 block diagram of p110 to p117 ..................................................................................................... 93 4-13 block diagram of p120 to p127 ..................................................................................................... 94 4-14 format of port mode register ........................................................................................................ 96 4-15 format of pull-up resistor option register ................................................................................... 97 5-1 clock generater block diagram ..................................................................................................... 101 5-2 feedback resistor of subsystem clock ........................................................................................ 102 5-3 format of processor clock control register ................................................................................. 103 5-4 format of display mode register 0 ............................................................................................... 105 5-5 format of display mode register 1 ............................................................................................... 108 5-6 external circuit of main system clock oscillator .......................................................................... 109 5-7 external circuit of subsystem clock oscillator ............................................................................. 110 5-8 examples of incorrect resonator connection ............................................................................... 111 5-9 main system clock stop function ................................................................................................. 115 5-10 system clock and cpu clock switching ....................................................................................... 118
17 user? manual u11302ej4v0um list of figures (2/6) figure no. title page 6-1 block diagram of 16-bit timer/event counter (timer mode) ....................................................... 123 6-2 block diagram of 16-bit timer/event counter (pwm mode) ........................................................ 124 6-3 block diagram of 16-bit timer/event counter output controller ................................................. 125 6-4 format of timer clock select register 0 ....................................................................................... 128 6-5 format of 16-bit timer mode control register ............................................................................. 130 6-6 format of 16-bit timer output control register ........................................................................... 131 6-7 format of port mode register 3 ..................................................................................................... 132 6-8 format of external interrupt mode register .................................................................................. 133 6-9 format of sampling clock select register .................................................................................... 134 6-10 interval timer configuration diagram ............................................................................................ 135 6-11 interval timer operation timing ..................................................................................................... 136 6-12 example of d/a converter configuration with pwm output ......................................................... 137 6-13 tv tuner application circuit example ........................................................................................... 138 6-14 configuration diagram for pulse width measurement in free-running mode ............................ 139 6-15 timing of pulse width measurement operation in free-running mode (with both edges specified) ........................................................................................................... 139 6-16 timing of pulse width measurement operation by means of restart (with both edges specified) ........................................................................................................... 140 6-17 external event counter configuration diagram ............................................................................ 141 6-18 external event counter operation timing (with rising edge specified) ..................................... 141 6-19 square-wave output operation timing ......................................................................................... 142 6-20 16-bit timer register start timing ................................................................................................. 143 6-21 timing after compare register change during timer count operation ..................................... 143 6-22 capture register data retention timing ....................................................................................... 144 7-1 block diagram of 8-bit timer/event counter ................................................................................. 151 7-2 block diagram of 8-bit timer/event counter output controller 1 ................................................ 152 7-3 block diagram of 8-bit timer/event counter output controller 2 ................................................ 152 7-4 format of timer clock select register 1 ....................................................................................... 154 7-5 format of 8-bit timer mode control register ............................................................................... 155 7-6 format of 8-bit timer output control register .............................................................................. 156 7-7 format of port mode register 3 ..................................................................................................... 157 7-8 interval timer operation timing ..................................................................................................... 158 7-9 external event counter operation timing (with rising edge specified) ..................................... 160 7-10 square-wave output operation timing ......................................................................................... 161 7-11 interval timer operation timing ..................................................................................................... 162 7-12 external event counter operation timing (with rising edge specified) ..................................... 164 7-13 square-wave output operation timing ......................................................................................... 165 7-14 8-bit timer register start timing ................................................................................................... 166 7-15 external event counter operation timing ..................................................................................... 166 7-16 timing after compare register change during timer count operation ..................................... 167
18 user? manual u11302ej4v0um list of figures (3/6) figure no. title page 8-1 watch timer block diagram ........................................................................................................... 170 8-2 format of timer clock select register 2 ....................................................................................... 171 8-3 format of watch timer mode control register ............................................................................. 172 9-1 watchdog timer block diagram ..................................................................................................... 176 9-2 format of timer clock select register 2 ....................................................................................... 178 9-3 format of watchdog timer mode register .................................................................................... 179 10-1 remote controlled output application example ........................................................................... 182 10-2 clock output controller block diagram ......................................................................................... 183 10-3 format of timer clock select register 0 ....................................................................................... 184 10-4 format of port mode register 3 ..................................................................................................... 185 11-1 buzzer output controller block diagram ....................................................................................... 186 11-2 format of timer clock select register 2 ....................................................................................... 188 11-3 format of port mode register 3 ..................................................................................................... 189 12-1 a/d converter block diagram ........................................................................................................ 191 12-2 format of a/d converter mode register ....................................................................................... 195 12-3 format of a/d converter input select register ............................................................................. 196 12-4 basic operation of a/d converter .................................................................................................. 198 12-5 relationship between analog input voltage and a/d conversion result ................................... 199 12-6 a/d conversion by hardware start ................................................................................................ 200 12-7 a/d conversion by software start ................................................................................................. 201 12-8 example of method of reducing power consumption in standby mode .................................... 202 12-9 analog input pin processing .......................................................................................................... 203 12-10 a/d conversion end interrupt request generation timing .......................................................... 204 12-11 av dd pin connection ....................................................................................................................... 204 13-1 block diagram of serial interface channel 0 ................................................................................ 208 13-2 format of timer clock select register 3 ....................................................................................... 212 13-3 format of serial operating mode register 0 ................................................................................. 213 13-4 format of serial bus interface control register ........................................................................... 214 13-5 format of interrupt timing specification register ......................................................................... 216 13-6 3-wire serial i/o mode timing ....................................................................................................... 221 13-7 relt and cmdt operations .......................................................................................................... 222 13-8 circuit for switching transfer bit order ......................................................................................... 222 13-9 example of serial bus configuration with sbi .............................................................................. 224 13-10 sbi transfer timing ........................................................................................................................ 226 13-11 bus release signal ......................................................................................................................... 227 13-12 command signal ............................................................................................................................. 22 7 13-13 address ............................................................................................................................... ............. 228 13-14 slave selection by address ............................................................................................................ 228 13-15 commands ............................................................................................................................... ........ 229
19 user? manual u11302ej4v0um list of figures (4/6) figure no. title page 13-16 data ............................................................................................................................... ................... 229 13-17 acknowledge signal ........................................................................................................................ 230 13-18 busy and ready signals ............................................................................................................. 231 13-19 relt, cmdt, reld, and cmdd operations (master) ................................................................ 236 13-20 reld and cmdd operations (slave) ............................................................................................ 236 13-21 ackt operation .............................................................................................................................. 2 37 13-22 acke operations ............................................................................................................................ 238 13-23 ackd operations ............................................................................................................................ 239 13-24 bsye operation .............................................................................................................................. 2 39 13-25 pin configuration ............................................................................................................................. 24 2 13-26 address transmission from master device to slave device (wup = 1) ..................................... 244 13-27 command transmission from master device to slave device .................................................... 245 13-28 data transmission from master device to slave device .............................................................. 246 13-29 data transmission from slave device to master device .............................................................. 247 13-30 serial bus configuration example using 2-wire serial i/o mode ................................................ 249 13-31 2-wire serial i/o mode timing ....................................................................................................... 253 13-32 relt and cmdt operations .......................................................................................................... 254 13-33 sck0/p27 pin configuration .......................................................................................................... 255 14-1 block diagram of serial interface channel 1 ................................................................................ 258 14-2 format of timer clock select register 3 ....................................................................................... 261 14-3 format of serial operating mode register 1 ................................................................................. 262 14-4 format of automatic data transmit/receive control register ..................................................... 264 14-5 format of automatic data transmit/receive interval specification register .............................. 265 14-6 3-wire serial i/o mode timing ....................................................................................................... 270 14-7 circuit for switching transfer bit order ......................................................................................... 271 14-8 basic transmission/reception mode operation timing ............................................................... 279 14-9 basic transmission/reception mode flowchart ............................................................................ 280 14-10 buffer ram operation in 6-byte transmission/reception (in basic transmission/reception mode) ....................................................................................... 281 14-11 basic transmission mode operation timing ................................................................................. 283 14-12 basic transmission mode flowchart .............................................................................................. 284 14-13 buffer ram operation in 6-byte transmission (in basic transmission mode) ........................... 285 14-14 repeat transmission mode operation timing .............................................................................. 287 14-15 repeat transmission mode flowchart ........................................................................................... 288 14-16 buffer ram operation in 6-byte transmission (in repeat transmission mode) ........................ 289 14-17 automatic transmission/reception suspension and restart ....................................................... 291 14-18 system configuration with busy control option ........................................................................... 292 14-19 operation timing when using busy control option (busy0 = 0) .............................................. 293 14-20 busy signal and clearing wait (busy0 = 0) ................................................................................ 293 14-21 operation timing when using busy & strobe control option (busy0 = 0) ............................... 294 14-22 operation timing of bit slippage detection function using busy signal (busy0 = 1) ............. 295 14-23 automatic transmit/receive interval .............................................................................................. 296 14-24 operation timing when automatic transmit/receive function is operating with internal clock ............................................................................................................................... .... 297
20 user? manual u11302ej4v0um list of figures (5/6) figure no. title page 15-1 vfd controller operation timing in display mode 1 (dspm05 = 0) ........................................... 300 15-2 vfd controller/driver block diagram ............................................................................................ 302 15-3 format of display mode register 0 ............................................................................................... 305 15-4 format of display mode register 1 ............................................................................................... 307 15-5 format of display mode register 2 ............................................................................................... 308 15-6 cut width of segment/digit signal ................................................................................................. 310 15-7 vfd controller display start timing .............................................................................................. 310 15-8 selection of display mode .............................................................................................................. 311 15-9 pin configuration for 14-segment display ..................................................................................... 312 15-10 relationship between display data memory contents and segment output ............................. 313 15-11 light leakage due to short blanking time .................................................................................... 315 15-12 light leakage due to c sg ............................................................................................................... 316 15-13 waveform of light leakage due to c sg ......................................................................................... 316 15-14 display data memory configuration and segment data reading order (segment type) ............................................................................................................................... 318 15-15 relationship between display data memory contents and segment outputs in 10-segment x 11-digit display mode ........................................................................................ 319 15-16 display data memory configuration and segment data reading order (dot type) .................. 320 15-17 relationship between display data memory contents and segment outputs in 35-segment x 16-digit display mode ........................................................................................ 321 15-18 display data memory configuration and data reading order (display mode 2) ....................... 322 15-19 segment connection example ....................................................................................................... 323 15-20 grid driving timing ......................................................................................................................... 324 15-21 data memory status in 23-segment x 5-grid display mode ........................................................ 325 15-22 allowable total power dissipation p t (t a = ?0 to +85 c) .......................................................... 326 15-23 relationship between display data memory contents and segment outputs in 10-segment x 11-digit display mode ........................................................................................ 328 15-24 relationship between display data memory contents and segment outputs in 35-segment x 16-digit display mode ........................................................................................ 331 15-25 grid driving timing ......................................................................................................................... 333 15-26 data memory status in 23-segment x 5-grid display mode ........................................................ 334 16-1 basic configuration of interrupt function ...................................................................................... 337 16-2 format of interrupt request flag register .................................................................................... 340 16-3 format of interrupt mask flag register ......................................................................................... 341 16-4 format of priority specification flag register ............................................................................... 342 16-5 format of external interrupt mode register .................................................................................. 343 16-6 format of sampling clock select register .................................................................................... 344 16-7 noise eliminator i/o timing (when rising edge is detected) ..................................................... 345 16-8 format of program status word .................................................................................................... 346 16-9 non-maskable interrupt request acknowledgment flowchart ..................................................... 348 16-10 non-maskable interrupt request acknowledgment timing .......................................................... 348 16-11 non-maskable interrupt request acknowledgment operation ..................................................... 349
21 user? manual u11302ej4v0um list of figures (6/6) figure no. title page 16-12 interrupt request acknowledge processing algorithm ................................................................. 351 16-13 interrupt request acknowledgment timing (minimum time) ....................................................... 352 16-14 interrupt request acknowledgment timing (maximum time) ...................................................... 352 16-15 multiple interrupt servicing example .............................................................................................. 354 16-16 interrupt request hold .................................................................................................................... 356 16-17 basic configuration of test function ............................................................................................. 357 16-18 format of interrupt request flag register 0h .............................................................................. 358 16-19 format of interrupt mask flag register 0h ................................................................................... 358 17-1 format of oscillation stabilization time select register .............................................................. 360 17-2 halt mode release by interrupt request generation ................................................................ 362 17-3 halt mode release by reset input ........................................................................................... 363 17-4 stop mode release by interrupt request generation ................................................................ 365 17-5 stop mode release by reset input .......................................................................................... 366 18-1 block diagram of reset function ................................................................................................... 367 18-2 timing of reset by reset input ................................................................................................... 368 18-3 timing of reset due to watchdog timer overflow ....................................................................... 368 18-4 timing of reset by reset input in stop mode .......................................................................... 368 19-1 format of internal memory size switching register (ims) ........................................................... 373 19-2 format of internal expansion ram size switching register ........................................................ 374 19-3 page program mode flowchart ...................................................................................................... 377 19-4 page program mode timing ........................................................................................................... 378 19-5 byte program mode flowchart ....................................................................................................... 379 19-6 byte program mode timing ............................................................................................................ 380 19-7 prom read timing ........................................................................................................................ 381 b-1 configuration of development tools .............................................................................................. 400 b-2 ev-9200gf-100 package drawing (for reference purposes only) ............................................. 409 b-3 recommended footprint for ev-9200gf-100 (for reference purposes only) ............................ 410 b-4 distance between ie system and conversion adapter ................................................................ 411 b-5 connection conditions of target system (when np-100gf-tq is used) .................................. 412 b-6 connection conditions of target system (when np-h100gf-tq is used) ............................... 412
22 user? manual u11302ej4v0um list of tables (1/2) table no. title page 1-1 mask options in mask rom versions ........................................................................................... 33 2-1 types of pin i/o circuits ................................................................................................................. 43 3-1 internal rom capacity .................................................................................................................... 53 3-2 vector table ............................................................................................................................... ..... 53 3-3 special-function register list ........................................................................................................ 65 4-1 port functions ............................................................................................................................... .. 81 4-2 port configuration ........................................................................................................................... 83 4-3 port mode register and output latch setting when alternate function is used ...................... 95 4-4 comparison between mask option of mask rom version and pd78p0208 ............................ 99 5-1 clock generator configuration ....................................................................................................... 100 5-2 relationship between cpu clock and minimum instruction execution time ............................. 104 5-3 maximum time required for cpu clock switchover .................................................................... 117 6-1 timer/event counter operations .................................................................................................... 120 6-2 16-bit timer/event counter interval time ..................................................................................... 121 6-3 16-bit timer/event counter square-wave output ranges .......................................................... 121 6-4 16-bit timer/event counter configuration ..................................................................................... 122 6-5 16-bit timer/event counter interval time ..................................................................................... 136 6-6 16-bit timer/event counter square-wave output ranges .......................................................... 142 7-1 8-bit timer/event counter interval time ........................................................................................ 146 7-2 8-bit timer/event counter square-wave output ranges ............................................................ 147 7-3 interval time when 8-bit timer/event counter is used as 16-bit timer/event counter ........... 148 7-4 square-wave output ranges when 8-bit timer/event counter is used as 16-bit timer/event counter ......................................................................................... 149 7-5 8-bit timer/event counter configuration ....................................................................................... 150 7-6 8-bit timer/event counter 1 interval time .................................................................................... 159 7-7 8-bit timer/event counter 2 interval time .................................................................................... 159 7-8 8-bit timer/event counter square-wave output ranges ............................................................ 161 7-9 interval time when 2-channel 8-bit timer/event counter (tm1 and tm2) is used as 16-bit timer/event counter .............................................................. 163 7-10 square-wave output ranges when 2-channel 8-bit timer/event counters (tm1 and tm2) are used as 16-bit timer/event counter ........................................................... 165 8-1 interval timer interval time ............................................................................................................ 168 8-2 watch timer configuration ............................................................................................................. 169 8-3 interval timer interval time ............................................................................................................ 173 9-1 watchdog timer program loop detection time ........................................................................... 174 9-2 interval time ............................................................................................................................... ..... 174 9-3 watchdog timer configuration ....................................................................................................... 175 9-4 watchdog timer program loop detection time ........................................................................... 180
23 user? manual u11302ej4v0um list of tables (2/2) table no. title page 9-5 interval timer interval time ............................................................................................................ 181 10-1 clock output controller configuration ........................................................................................... 183 11-1 buzzer output controller configuration ......................................................................................... 186 12-1 a/d converter configuration ........................................................................................................... 190 13-1 differences between channels 0 and 1 ......................................................................................... 205 13-2 modes of serial interface channel 0 .............................................................................................. 206 13-3 configuration of serial interface channel 0 ................................................................................... 207 13-4 signals in sbi mode ........................................................................................................................ 240 14-1 modes of serial interface channel 1 .............................................................................................. 256 14-2 configuration of serial interface channel 1 ................................................................................... 257 14-3 interval determined by cpu processing (with internal clock operation) .................................... 297 14-4 interval determined by cpu processing (with external clock operation) .................................. 298 15-1 relationship between display output pins and port pins ............................................................ 301 15-2 vfd controller/driver configuration ............................................................................................... 301 15-3 segment lighting timing ................................................................................................................ 324 16-1 interrupt source list ........................................................................................................................ 336 16-2 various flags corresponding to interrupt request sources ........................................................ 339 16-3 times from maskable interrupt request generation to interrupt servicing ................................. 350 16-4 interrupt request enabled for multiple interrupt during interrupt servicing ................................ 353 17-1 halt mode operating status ......................................................................................................... 361 17-2 operation after halt mode release ............................................................................................ 363 17-3 stop mode operating status ........................................................................................................ 364 17-4 operation after stop mode release ............................................................................................ 366 18-1 hardware status after reset .......................................................................................................... 369 19-1 differences between pd78p0208 and mask rom versions ..................................................... 371 19-2 internal memory size switching register setting values ............................................................. 373 19-3 internal expansion ram size switching register setting values ................................................ 374 19-4 prom programming operating modes ......................................................................................... 375 20-1 operand identifiers and description methods ............................................................................... 384 a-1 major differences between pd78044h, 780228, and 780208 subseries ................................. 398 b-1 method for upgrading from former in-circuit emulator for 78k/0 series to ie-78001-r-a ....... 408 b-2 distance between ie system and conversion adapter ................................................................ 411
24 user? manual u11302ej4v0um chapter 1 outline 1.1 features internal high-capacity rom and ram item program memory data memory part rom prom internal high- buffer ram vfd display internal number speed ram ram expansion ram pd780204 32 kb 1024 bytes 64 bytes 80 bytes none pd780204a pd780205 40 kb pd780205a pd780206 48 kb 1024 bytes pd780208 60 kb pd78p0208 60 kb note 1 1024 bytes note 2 notes 1. 32, 40, 48, or 60 kb can be selected by setting the internal memory size switching register (ims). 2. 0 or 1024 bytes can be selected by setting the internal expansion ram size switching register (ixs). minimum instruction execution time can be changed from high speed (0.4 s: @ 5.0 mhz operation with main system clock) to ultra-low speed (122 s: @ 32.768 khz operation with subsystem clock) 74 i/o ports vfd controller/driver: 53 display outputs in total segments: 9 to 40 digits: 2 to 16 8-bit resolution a/d converter: 8 channels power supply voltage (av dd = 4.0 to 5.5 v) serial interface: 2 channels 3-wire serial i/o/sbi/2-wire serial i/o mode: 1 channel 3-wire serial i/o mode (automatic transmit/receive function): 1 channel timer: 5 channels 16-bit timer/event counter: 1 channel 8-bit timer/event counter: 2 channels watch timer: 1 channel watchdog timer: 1 channel 15 vectored interrupt sources one test input two types of on-chip clock oscillators (for main and subsystem clocks) power supply voltage: v dd = 2.7 to 5.5 v
chapter 1 outline 25 user? manual u11302ej4v0um 1.2 applications compact home stereo sets, cassette decks, tuners, cd players, vcrs, etc. 1.3 ordering information part number package internal rom pd780204gf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd780204agf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd780205gf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd780205agf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd780206gf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd780208gf-xxx-3ba 100-pin plastic qfp (14 x 20) mask rom pd78p0208gf-3ba 100-pin plastic qfp (14 x 20) one-time prom remark xxx indicates rom code suffix. 1.4 quality grade part number package quality grade pd780204gf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd780204agf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd780205gf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd780205agf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd780206gf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd780208gf-xxx-3ba 100-pin plastic qfp (14 x 20) standard pd78p0208gf-3ba 100-pin plastic qfp (14 x 20) standard remark xxx indicates rom code suffix.
chapter 1 outline 26 user? manual u11302ej4v0um 1.5 pin configuration (top view) (1) normal operating mode 100-pin plastic qfp (14 x 20) pd780204gf-xxx-3ba, 780204agf-xxx-3ba, 780205gf-xxx-3ba, 780205agf-xxx-3ba, pd780206gf-xxx-3ba, 780208gf-xxx-3ba, 78p0208gf-3ba cautions 1. connect the ic (internally connected) pin directly to v ss . 2. connect the av dd pin to v dd . 3. connect the av ss pin to v ss . remark the pin connection in parentheses is intended for the pd78p0208. fip0 fip1 fip2 fip3 fip4 fip5 fip6 fip7 fip8 fip9 fip10 fip11 fip12 p80/fip13 p81/fip14 p82/fip15 p83/fip16 p84/fip17 p85/fip18 p86/fip19 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 v dd p37 p36/buz p35/pcl p34/ti2 p33/ti1 p32/to2 p31/to1 p30/to0 reset x2 x1 ic (v pp ) xt2 p04/xt1 v dd p27/sck0 p26/so0/sb1 p25/si0/sb0 p24/busy p23/stb p22/sck1 p21/so1 p20/si1 av ss p17/ani7 p16/ani6 p15/ani5 p14/ani4 p13/ani3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 p87/fip20 v load p90/fip21 p91/fip22 p92/fip23 p93/fip24 p94/fip25 p95/fip26 p96/fip27 p97/fip28 p100/fip29 p101/fip30 p102/fip31 p103/fip32 p104/fip33 p105/fip34 p106/fip35 p107/fip36 p110/fip37 p111/fip38 p112/fip39 p113/fip40 p114/fip41 p115/fip42 p116/fip43 p117/fip44 p120/fip45 p121/fip46 p122/fip47 p123/fip48 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 p12/ani2 p11/ani1 p10/ani0 av dd av ref p03/intp3 p02/intp2 p01/intp1 p00/intp0/ti0 v ss p74 p73 p72 p71 p70 v dd p127/fip52 p126/fip51 p125/fip50 p124/fip49
chapter 1 outline 27 user s manual u11302ej4v0um p110 to p117: port 11 p120 to p127: port 12 pcl: programmable clock reset: reset sb0, sb1: serial bus sck0, sck1: serial clock si0, si1: serial input so0, so1: serial output stb: strobe ti0 to ti2: timer input to0 to to2: timer output v dd : power supply v load : negative power supply v pp : programming power supply v ss : ground x1, x2: crystal (main system clock) xt1, xt2: crystal (subsystem clock) ani0 to ani7: analog input av dd : analog power supply av ref : analog reference voltage av ss : analog ground busy: busy buz: buzzer clock fip0 to fip52: fluorescent indicator panel ic: internally connected intp0 to intp3: external interrupt input p00 to p04: port 0 p10 to p17: port 1 p20 to p27: port 2 p30 to p37: port 3 p70 to p74: port 7 p80 to p87: port 8 p90 to p97: port 9 p100 to p107: port 10
chapter 1 outline 28 user s manual u11302ej4v0um (2) prom programming mode 100-pin plastic qfp (14 x 20) pd78p0208gf-3ba cautions 1. (l): connect independently to v ss via a pull-down resistor. 2. (d): connect via a driver. 3. v ss : connect to ground. 4. reset: set to low level. 5. open: do not connect to anything. a0 to a16: address bus oe: output enable v dd : power supply ce: chip enable pgm: program v pp : programming power supply d0 to d7: data bus reset: reset v ss : ground v dd d7 d6 d5 d4 d3 d2 d1 d0 reset open (l) v pp open (l) v dd a7 a6 a5 a4 a3 a2 a1 a0 v ss ce oe (l) (d) (l) (d) (d) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 (l) v ss a8 a16 a10 a11 a12 a13 a14 a15 (l) (l) (d) 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 (l) (l) v dd v ss (l) (l) a9 v ss v dd (l) (l) (d) pgm
chapter 1 outline 29 user s manual u11302ej4v0um 1.6 78k/0 series lineup the 78k/0 series product lineup is illustrated below. the part numbers in boxes indicate subseries names. remark vfd (vacuum fluorescent display) is referred to as fip tm (fluorescent indicator panel) in some documents, but the functions of the two are the same. pd78083 pd78018f pd78018fy pd78014h emi-noise reduced version of the pd78018f basic subseries for control on-chip uart, capable of operating at low voltage (1.8 v) 42/44-pin 64-pin 64-pin 52-pin 52-pin version of the pd780024a pd780024as 52-pin 52-pin version of the pd780034a pd780034as pd78054 with iebus tm controller pd78054 with enhanced serial i/o pd78078y with enhanced serial i/o and limited functions pd78054 with timer and enhanced external interface 64-pin 64-pin 80-pin 80-pin 80-pin emi-noise reduced version of the pd78054 pd78018f with uart and d/a converter, and enhanced i/o pd780034a pd780988 pd780034ay 64-pin pd780024a with expanded ram pd780024a with enhanced a/d converter on-chip inverter controller and uart. emi-noise reduced. pd78064 pd78064b pd780308 100-pin 100-pin 100-pin pd780308y pd78064y 80-pin 78k/0 series lcd drive pd78064 with enhanced sio, and expanded rom and ram emi-noise reduced version of the pd78064 basic subseries for driving lcds, on-chip uart bus interface supported pd78018f with enhanced serial i/o 80-pin 100-pin 100-pin products in mass production products under development y subseries products are compatible with i 2 c bus. romless version of the pd78078 100-pin 100-pin emi-noise reduced version of the pd78078 inverter control pd780208 100-pin vfd drive pd78044f with enhanced i/o and vfd c/d. display output total: 53 pd78098b 100-pin pd780024a pd780024ay 80-pin 80-pin pd780852 pd780828b for automobile meter driver. on-chip can controller 100-pin pd780958 for industrial meter control on-chip automobile meter controller/driver meter control 80-pin on-chip iebus controller 80-pin on-chip controller compliant with j1850 (class 2) pd780833y pd780948 on-chip can controller 64-pin pd780078 pd780078y pd780034a with timer and enhanced serial i/o pd78054 pd78054y pd78058f pd78058fy pd780058 pd780058y pd78070a pd78070ay pd78078 pd78078y pd780018ay control pd78075b pd780065 pd78044h pd780232 80-pin 80-pin for panel control. on-chip vfd c/d. display output total: 53 pd78044f with n-ch open-drain i/o. display output total: 34 pd78044f 80-pin basic subseries for driving vfd. display output total: 34 120-pin pd780308 with enhanced display function and timer. segment signal output: 40 pins max. pd780318 pd780328 120-pin 120-pin pd780308 with enhanced display function and timer. segment signal output: 32 pins max. pd780308 with enhanced display function and timer. segment signal output: 24 pins max. pd780338 pd780308 with enhanced display function and timer. segment signal output: 40 pins max. on-chip can controller specialized for can controller function 80-pin pd780703ay pd780702y 64-pin pd780816 pd780344 with enhanced a/d converter 100-pin 100-pin pd780344 pd780344y pd780354 pd780354y
chapter 1 outline 30 user s manual u11302ej4v0um the following lists the main functional differences between subseries products. non-y subseries function rom timer 8-bit 10-bit 8-bit serial interface i/o external subseries name 8-bit 16-bit watch wdt a/d a/d d/a expansion control pd78075b 32 k to 40 k 4 ch 1 ch 1 ch 1 ch 8 ch 2 ch 3 ch (uart: 1 ch) 88 1.8 v pd78078 48 k to 60 k pd78070a 61 2.7 v pd780058 24 k to 60 k 2 ch 3 ch (time-division uart: 1 ch) 68 1.8 v pd78058f 48 k to 60 k 3 ch (uart: 1 ch) 69 2.7 v pd78054 16 k to 60 k 2.0 v pd780065 40 k to 48 k 4 ch (uart: 1 ch) 60 2.7 v pd780078 48 k to 60 k 2 ch 8 ch 3 ch (uart: 2 ch) 52 1.8 v pd780034a 8 k to 32 k 1 ch 3 ch (uart: 1 ch) 51 pd780024a 8 ch pd780034as 4 ch 39 pd780024as 4 ch pd78014h 8 ch 2 ch 53 pd78018f 8 k to 60 k pd78083 8 k to 16 k 1 ch (uart: 1 ch) 33 inverter pd780988 16 k to 60 k 3 ch note 1 ch 8 ch 3 ch (uart: 2 ch) 47 4.0 v control vfd pd780208 32 k to 60 k 2 ch 1 ch 1 ch 1 ch 8 ch 2 ch 74 2.7 v drive pd780232 16 k to 24 k 3 ch 4 ch 40 4.5 v pd78044h 32 k to 48 k 2 ch 1 ch 1 ch 8 ch 1 ch 68 2.7 v pd78044f 16 k to 40 k 2 ch lcd pd780354 24 k to 32 k 4 ch 1 ch 1 ch 1 ch 8 ch 3 ch (uart: 1 ch) 66 1.8 v drive pd780344 8 ch pd780338 48 k to 60 k 3 ch 2 ch 10 ch 1 ch 2 ch (uart: 1 ch) 54 pd780328 62 pd780318 70 pd780308 48 k to 60 k 2 ch 1 ch 8 ch 3 ch (time-division uart: 1 ch) 57 2.0 v pd78064b 32 k 2 ch (uart: 1 ch) pd78064 16 k to 32 k bus pd780948 60 k 2 ch 2 ch 1 ch 1 ch 8 ch 3 ch (uart: 1 ch) 79 4.0 v interface pd78098b 40 k to 60 k 1 ch 2 ch 69 2.7 v supported pd780816 32 k to 60 k 2 ch 12 ch 2 ch (uart: 1 ch) 46 4.0 v meter pd780958 48 k to 60 k 4 ch 2 ch 1 ch 2 ch (uart: 1 ch) 69 2.2 v control dash- pd780852 32 k to 40 k 3 ch 1 ch 1 ch 1 ch 5 ch 3 ch (uart: 1 ch) 56 4.0 v board control pd780828b 32 k to 60 k 59 note 16-bit timer: 2 channels 10-bit timer: 1 channel v dd min. value capacity (bytes)
chapter 1 outline 31 user s manual u11302ej4v0um 1.7 block diagram remarks 1. the internal rom and ram capacities vary depending on the product. 2. pin names in parentheses only apply to the pd78p0208. 16-bit timer/ event counter 8-bit timer/ event counter 1 8-bit timer/ event counter 2 watchdog timer watch timer serial interface 0 serial interface 1 a/d converter interrupt control clock output control buzzer output to0/p30 ti0/p00 to1/p31 ti1/p33 to2/p32 ti2/p34 si0/sb0/p25 so0/sb1/p26 sck0/p27 si1/p20 so1/p21 sck1/p22 stb/p23 busy/p24 ani0/p10 to ani7/p17 av dd av ss av ref intp0/p00 to intp3/p03 buz/p36 pcl/p35 78k/0 cpu core rom ram v dd v ss ic (v pp ) port 0 port 1 port 2 port 3 port 7 port 8 port 9 port 10 port 11 port 12 vfd controller/ driver system control p01 to p03 p00 p04 p10 to p17 p20 to p27 p30 to p37 p70 to p74 p80 to p87 p90 to p97 p100 to p107 p110 to p117 p120 to p127 fip0 to fip52 v load reset x1 x2 xt1/p04 xt2
chapter 1 outline 32 user s manual u11302ej4v0um 1.8 overview of functions rom mask rom one-time prom 32 kb note 1 40 kb note 1 48 kb 60 kb 60 kb note 2 high-speed ram 1024 bytes expansion ram 1024 bytes 1024 bytes note 3 buffer ram 64 bytes vfd display ram 80 bytes general-purpose registers 8 bits x 8 x 4 banks with main system 0.4 s/0.8 s/1.6 s/3.2 s/6.4 s (when operated at 5.0 mhz) clock selected with subsystem 122 s (when operated at 32.768 khz) clock selected 16-bit operation multiply/divide (8 bits x 8 bits, 16 bits 8 bits) bit manipulation (set, reset, test, and boolean operation) bcd adjust, and other related operations i/o ports (including vfd pins) total: 74 pins cmos input: 2 pins cmos i/o: 27 pins n-ch open-drain i/o: 5 pins p-ch open-drain i/o: 24 pins p-ch open-drain output: 16 pins vfd controller/driver total of display output: 53 pins segments: 9 to 40 pins digits: 2 to 16 pins a/d converter 8-bit resolution x 8 channels power supply voltage: av dd = 4.0 to 5.5 v serial interface 3-wire serial i/o/sbi/2-wire serial i/o mode selection possible: 1 channel 3-wire serial i/o mode (maximum 64-byte on-chip automatic transmit/receive function): 1 channel notes 1. the initial value of the internal memory size switching register (ims) in the pd780204a and 780205a is fixed to cfh (60 kb), regardless of the internal memory capacity. therefore, set the values shown below for each product before use. pd780204a: c8h (32 kb) pd780205a: cah (40 kb) 2. 32, 40, 48, or 60 kb can be selected by the internal memory size switching register (ims). 3. 0 or 1024 bytes can be selected by the internal expansion ram size switching register (ixs). item part number internal memory instruction set minimum instruction execution time pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208
chapter 1 outline 33 user s manual u11302ej4v0um item part number timer 16-bit timer/event counter: 1 channel 8-bit timer/event counter: 2 channels watch timer: 1 channel watchdog timer: 1 channel timer output 3 outputs (14-bit pwm generation possible from one output) clock output 19.5 khz, 39.1 khz, 78.1 khz, 156 khz, 313 khz, 625 khz (@ 5.0 mhz operation with main system clock) 32.768 khz (@ 32.768 khz operation with subsystem clock) buzzer output 1.2 khz, 2.4 khz, 4.9 khz (@ 5.0 mhz operation with main system clock) vectored maskable interrupts internal: 9, external: 4 interrupt sources non-maskable interrupts internal: 1 software interrupts 1 test input internal: 1 power supply voltage v dd = 2.7 to 5.5 v package 100-pin plastic qfp (14 x 20) 1.9 mask options the mask rom versions ( pd780204, pd780204a, pd780205, pd780205a, pd780206, and pd780208) have mask options. by specifying the mask options when ordering, the pull-up resistors and pull-down resistors listed in table 1-1 can be incorporated. when these resistors are necessary, the number of external components and mounting space can be saved by utilizing the mask options. table 1-1 shows the mask options provided in the pd780208 subseries products. table 1-1. mask options in mask rom versions pin name mask option p30/to0 to p32/to2, p33/ti1, p34/ti2, on-chip pull-down resistor can be specified in 1-bit units. p35/pcl, p36/buz, p37 p70 to p74 on-chip pull-up resistor can be specified in 1-bit units. fip0 to fip12 on-chip pull-down resistor can be specified in 1-bit units. p80/fip13 to p87/fip20, p90/fip21 to on-chip pull-down resistor can be specified in 1-bit units. p97/fip28, p100/fip29 to p107/fip36, the connect destination of a pull-down resistor can be specified for v load or p110/fip37 to p117/fip44, v ss in 4-bit units from p80. p120/fip45 to p127/fip52 caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208
34 user? manual u11302ej4v0um chapter 2 pin functions 2.1 pin function list 2.1.1 normal operating mode pins (1) port pins (1/2) pin name i/o function after alternate reset function p00 input input only input intp0/ti0 p01 i/o input intp1 p02 intp2 p03 intp3 p04 note 1 input input only input xt1 p10 to p17 i/o port 1. input ani0 to ani7 8-bit i/o port. input/output can be specified in 1-bit units. if used as an input port, use of an on-chip pull-up resistor can be specified by software settings note 2 . p20 i/o input si1 p21 so1 p22 sck1 p23 stb p24 busy p25 si0/sb0 p26 so0/sb1 p27 sck0 p30 i/o input to0 p31 to1 p32 to2 p33 ti1 p34 ti2 p35 pcl p36 buz p37 notes 1. when the p04/xt1 pin is used as an input port, set bit 6 (frc) of the processor clock control register (pcc) to 1 (do not use the feedback resistor contained in the subsystem clock oscillator). 2. when the p10/ani0 to p17/ani7 pins are used as analog inputs of the a/d converter, set port 1 to the input mode. in this case, its on-chip pull-up resistor will be automatically disabled. port 0. 5-bit i/o port. input/output can be specified in 1-bit units. if used as an input port, use of an on-chip pull-up resistor can be specified by software settings. port 2. 8-bit i/o port. input/output can be specified in 1-bit units. if used as an input port, use of an on-chip pull-up resistor can be specified by software settings. port 3. 8-bit i/o port. input/output can be specified in 1-bit units. leds can be driven directly. if used as an input port, use of an on-chip pull-up resistor can be specified by software settings. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option.
chapter 2 pin functions 35 user? manual u11302ej4v0um (1) port pins (2/2) pin name i/o function after alternate reset function p70 to p74 i/o port 7. input n-ch open-drain 5-bit i/o port. leds can be driven directly. input/output can be specified in 1-bit units. in mask rom versions, use of an on-chip pull-up resistor can be specified in 1-bit units with the mask option. p80 to p87 output port 8. output fip13 to fip20 p-ch open-drain 8-bit high-withstanding-voltage output port. leds can be driven directly. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option (connection to v load or v ss is specifiable in 4-bit units). p90 to p97 output port 9. output fip21 to fip28 p-ch open-drain 8-bit high-withstanding-voltage output port. leds can be driven directly. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option (connection to v load or v ss is specifiable in 4-bit units). p100 to p107 i/o port 10. input fip29 to fip36 p-ch open-drain 8-bit high-withstanding-voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option (connection to v load or v ss is specifiable in 4-bit units). p110 to p117 i/o port 11. input fip37 to fip44 p-ch open-drain 8-bit high-withstanding-voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option (connection to v load or v ss is specifiable in 4-bit units). p120 to p127 i/o port 12. input fip45 to fip52 p-ch open-drain 8-bit high-withstanding-voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of an on-chip pull-down resistor can be specified in 1-bit units with the mask option (connection to v load or v ss is specifiable in 4-bit units).
chapter 2 pin functions 36 user? manual u11302ej4v0um (2) non-port pins (1/2) pin name i/o function after alternate reset function intp0 input input p00/ti0 intp1 p01 intp2 p02 intp3 external interrupt request input with falling edge detection p03 si0 input serial interface serial data input input p25/sb0 si1 p20 so0 output serial interface serial data output input p26/sb1 so1 p21 sb0 i/o serial interface serial data input/output input p25/si0 sb1 p26/so0 sck0 i/o serial interface serial clock input/output input p27 sck1 p22 stb output serial interface automatic transmit/receive strobe output input p23 busy input serial interface automatic transmit/receive busy input input p24 ti0 input input of external count clock to 16-bit timer (tm0) input p00/intp0 ti1 input of external count clock to 8-bit timer (tm1) p33 ti2 input of external count clock to 8-bit timer (tm2) p34 to0 output 16-bit timer (tm0) output (also used for 14-bit pwm output) input p30 to1 8-bit timer (tm1) output p31 to2 8-bit timer (tm2) output p32 pcl output clock output (for trimming main system clock and subsystem clock) input p35 buz output buzzer output input p36 fip0 to fip12 output high withstanding voltage and high current output for vfd controller/ output driver display output. in mask rom versions, use of an on-chip pull-down resistor can be specified with the mask option. the pd78p0208 has on-chip pull-down resistors (connected to v load ). fip13 to fip20 output output p80 to p87 fip21 to fip28 p90 to p97 fip29 to fip36 input p100 to p107 fip37 to fip44 p110 to p117 fip45 to fip52 p120 to p127 v load pull-down resistor connection for vfd controller/driver ani0 to ani7 input a/d converter analog input input p10 to p17 av ref input a/d converter reference voltage input av dd a/d converter analog power supply. connect to v dd . av ss a/d converter ground potential. connect to v ss . reset input system reset input external interrupt request inputs for which the valid edges (rising edge, falling edge, or both rising and falling edges) can be specified. high withstanding voltage and high current output for vfd controller/ driver display output. in mask rom versions, use of an on-chip pull-down resistor can be specified with the mask option. the pd78p0208 has no on-chip pull-down resistors.
chapter 2 pin functions 37 user? manual u11302ej4v0um (2) non-port pins (2/2) pin name i/o function after alternate reset function x1 input crystal resonator connection for main system clock oscillation x2 xt1 input crystal resonator connection for subsystem clock oscillation input p04 xt2 v dd positive power supply v pp high-voltage application for program write/verify. connect directly to v ss in normal operation mode. v ss ground potential ic internally connected. connect directly to v ss . 2.1.2 prom programming mode pins ( pd78p0208 only) pin name i/o function reset input prom programming mode setting. when +5 v or +12.5 v is applied to the v pp pin or a low-level voltage is applied to the reset pin, the prom programming mode is set. v pp input high-voltage application for prom programming mode setting and program write/verify a0 to a16 input address bus d0 to d7 i/o data bus ce input prom enable input/program pulse input oe input read strobe input to prom pgm input program/program inhibit input in prom programming mode v dd positive power supply v ss ground potential
chapter 2 pin functions 38 user? manual u11302ej4v0um 2.2 description of pin functions 2.2.1 p00 to p04 (port 0) these pins constitute a 5-bit i/o port. besides serving as i/o port pins, they function as external interrupt request inputs, an external count clock input to the timer, a capture trigger signal input, and crystal resonator connection for subsystem clock oscillation. the following operating modes can be specified in 1-bit units. (1) port mode p00 and p04 function as input-only port pins and p01 to p03 function as i/o port pins. p01 to p03 can be specified in input or output mode in 1-bit units using port mode register 0 (pm0). when they are used as input port pins, an on-chip pull-up resistor can be used by setting the pull-up resistor option register (puo). (2) control mode p00 to p04 function as external interrupt request inputs, an external count clock input to the timer, and crystal connection for subsystem clock oscillation. (a) intp0 to intp3 intp0 to intp2 are external interrupt request input pins for which valid edges can be specified (rising edge, falling edge, and both rising and falling edges). intp0 becomes a 16-bit timer/event counter capture trigger signal input pin with a valid edge input. intp3 becomes a falling edge detection external interrupt request input pin. (b) ti0 ti0 is a pin for inputting the external count clock to the 16-bit timer/event counter. (c) xt1 crystal connection pin for subsystem clock oscillation 2.2.2 p10 to p17 (port 1) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as a/d converter analog inputs. the following operating modes can be specified in 1-bit units. (1) port mode p10 to p17 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 1 (pm1). when they are used as input port pins, an on-chip pull-up resistor can be used by setting the pull-up resistor option register (puo). (2) control mode p10 to p17 function as a/d converter analog input pins (ani0 to ani7). the on-chip pull-up resistors are automatically disabled when the pins are specified for analog input.
chapter 2 pin functions 39 user? manual u11302ej4v0um 2.2.3 p20 to p27 (port 2) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as serial interface data i/ o, clock i/o, automatic transmit/receive busy input, and strobe output pins. the following operating modes can be specified in 1-bit units. (1) port mode p20 to p27 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 2 (pm2). when they are used as input port pins, an on-chip pull-up resistor can be used by setting the pull-up resistor option register (puo). (2) control mode p20 to p27 function as serial interface data i/o, clock i/o, automatic transmit/receive busy input, and strobe output pins. (a) si0, si1, so0, so1 serial interface serial data i/o pins (b) sck0 and sck1 serial interface serial clock i/o pins (c) sb0 and sb1 nec electronics standard serial bus interface i/o pins (d) busy serial interface automatic transmit/receive busy input pin (e) stb serial interface automatic transmit/receive strobe output pin caution if port 2 is used as serial interface pins, the i/o and output latches must be set according to the function. for the setting method, refer to figure 13-3 format of serial operating mode register 0 and figure 14-3 format of serial operating mode register 1. 2.2.4 p30 to p37 (port 3) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as timer i/o, clock output, and buzzer output pins. in mask rom versions, use of pull-down resistors can be specified with the mask option. port 3 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p30 to p37 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 3 (pm3). when they are used as input port pins, an on-chip pull-up resistor can be used by setting the pull-up resistor option register (puo).
chapter 2 pin functions 40 user? manual u11302ej4v0um (2) control mode p30 to p37 function as timer i/o, clock output, and buzzer output pins. (a) ti1 and ti2 pins for external count clock input to the 8-bit timer/event counter. (b) to0 to to2 timer output pins (c) pcl clock output pin (d) buz buzzer output pin 2.2.5 p70 to p74 (port 7) these pins constitute a 5-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 7 (pm7). port 7 can drive leds directly. p70 to p74 are n-ch open-drain outputs. in mask rom versions, use of pull-up resistors can be specified with the mask option. 2.2.6 p80 to p87 (port 8) these pins constitute an 8-bit output-only port. besides serving as output port pins, they function as display outputs for the vfd controller/driver. port 8 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p80 to p87 function as an 8-bit output-only port. p80 to p87 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. (2) control mode p80 to p87 function as the display output pins of the vfd controller/driver (fip13 to fip20). 2.2.7 p90 to p97 (port 9) these pins constitute an 8-bit output-only port. besides serving as output port pins, they function as display outputs for the vfd controller/driver. port 9 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p90 to p97 function as an 8-bit output-only port. p90 to p97 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. (2) control mode p90 to p97 function as the display output pins of the vfd controller/driver (fip21 to fip28).
chapter 2 pin functions 41 user? manual u11302ej4v0um 2.2.8 p100 to p107 (port 10) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as display outputs for the vfd controller/driver. port 10 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p100 to p107 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 10 (pm10). p100 to p107 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. (2) control mode p100 to p107 function as display output pins for the vfd controller/driver (fip29 to fip36). 2.2.9 p110 to p117 (port 11) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as display outputs for the vfd controller/driver. port 11 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p110 to p117 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 11 (pm11). p110 to p117 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. (2) control mode p110 to p117 function as display output pins for the vfd controller/driver (fip37 to fip44). 2.2.10 p120 to p127 (port 12) these pins constitute an 8-bit i/o port. besides serving as i/o port pins, they function as display outputs for the vfd controller/driver. port 12 can drive leds directly. the following operating modes can be specified in 1-bit units. (1) port mode p120 to p127 function as an 8-bit i/o port. they can be specified in input or output mode in 1-bit units using port mode register 12 (pm12). p120 to p127 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. (2) control mode p120 to p127 function as display output pins for the vfd controller/driver (fip45 to fip52). 2.2.11 fip0 to fip12 these are display output pins for the vfd controller/driver. fip0 to fip12 are p-ch open-drain outputs. in mask rom versions, use of pull-down resistors can be specified with the mask option. the pd78p0208 contains pull-down resistors at fip0 to fip12 (connected to v load ).
chapter 2 pin functions 42 user? manual u11302ej4v0um 2.2.12 v load this is the pull-down resistor connection pin of the vfd controller/driver. 2.2.13 av ref the a/d converter? reference voltage should be input from this pin. 2.2.14 av dd this pin supplies power for a/d converter operations. always make this pin the same potential as the v dd pin even if the a/d converter is not used. 2.2.15 av ss this pin is the ground for the a/d converter. always make this pin the same potential as the v ss pin even if the a/d converter is not used. 2.2.16 reset this is an active-low system reset input pin. 2.2.17 x1 and x2 these are crystal resonator connection pins for main system clock oscillation. for external clock supply, input the clock to x1 and its inverted signal to x2. 2.2.18 xt1 and xt2 these are crystal resonator connection pins for subsystem clock oscillation. for external clock supply, input the clock to xt1 and its inverted signal to xt2. 2.2.19 v dd this is the positive power supply pin. 2.2.20 v ss this is the ground potential pin. 2.2.21 v pp ( pd78p0208 only) a high-voltage should be applied to this pin during prom programming mode setting and in program write/verify mode. connect directly to v ss in normal operation mode. 2.2.22 ic (mask rom version only) the ic (internally connected) pin sets a test mode in which the pd780204, 780204a, 780205, 780205a, 780206, and 780208 are tested before shipment. in normal operation mode, connect the ic pin directly to the v ss pin with as short a wiring length as possible. if there is a potential difference between the ic and v ss pins because the wiring length between the ic and v ss pins is too long, or external noise is superimposed on the ic pin, the user program may not run correctly. ?directly connect the ic pin to the v ss pin. v ss ic keep the wiring length as short as possible.
chapter 2 pin functions 43 user s manual u11302ej4v0um 2.3 pin i/o circuits and recommended connection of unused pins table 2-1 shows the i/o circuit types of pins and the recommended connections of unused pins. refer to figure 2-1 for the configuration of the i/o circuit of each type. table 2-1. types of pin i/o circuits (1/2) pin name i/o i/o recommended connection of unused pins circuit type p00/intp0/ti0 2 input connect to v ss . p01/intp1 8-a i/o input: independently connect to v ss via a resistor. p02/intp2 output: leave open. p03/intp3 p04/xt1 16 input connect to v dd or v ss . p10/ani0 to p17/ani7 11 i/o input: independently connect to v dd or v ss via a resistor. p20/si1 8-a output: leave open. p21/so1 5-a p22/sck1 8-a p23/stb 5-a p24/busy 8-a p25/si0/sb0 10-a p26/so0/sb1 p27/sck0 mask rom version p30/to0 5-c i/o input: independently connect to v dd or v ss via a resistor note . p31/to1 output: leave open. p32/to2 p33/ti1 8-b p34/ti2 p35/pcl 5-c p36/buz p37 note leave open when an on-chip pull-down resistor is specified by the mask option.
chapter 2 pin functions 44 user s manual u11302ej4v0um table 2-1. types of pin i/o circuits (2/2) pin name i/o i/o recommended connection of unused pins circuit type pd78p0208 p30/to0 5-a i/o input: independently connect to v dd or v ss via a resistor. p31/to1 output: leave open. p32/to2 p33/ti1 8-a p34/ti2 p35/pcl 5-a p36/buz p37 mask rom version p70 to p74 13-b i/o input: independently connect to v dd or v ss via a resistor note . output: leave open. fip0 to fip12 14-a output leave open. p80/fip13 to p87/fip20 p90/fip21 to p97/fip28 p100/fip29 to p107/fip36 15-c i/o input: independently connect to v dd or v ss via a resistor note . p110/fip37 to p117/fip44 output: leave open. p120/fip45 to p127/fip52 ic connect directly to v ss . pd78p0208 p70 to p74 13-d i/o input: independently connect to v dd or v ss via a resistor. output: leave open. fip0 to fip12 14 output leave open. p80/fip13 to p87/fip20 14-b output leave open. p90/fip21 to p97/fip28 p100/fip29 to p107/fip36 15-b i/o input: independently connect to v dd or v ss via a resistor. p110/fip37 to p117/fip44 output: leave open. p120/fip45 to p127/fip52 v pp connect directly to v ss . reset 2 input xt2 16 leave open. av ref connect directly to v ss . av dd connect directly to v dd . av ss connect directly to v ss . v load note leave open when an on-chip pull-up or pull-down resistor is specified by the mask option.
chapter 2 pin functions 45 user s manual u11302ej4v0um figure 2-1. pin i/o circuits (1/3) in pull-up enable v dd p-ch in/out input enable output disable data v dd p-ch n-ch type 2 type 5-a schmitt-triggered input with hysteresis characteristics type 5-c type 10-a type 8-b type 8-a pull-up enable v dd p-ch in/out output disable data v dd p-ch n-ch pull-up enable v dd p-ch in/out output disable data v dd p-ch n-ch pull-up enable v dd p-ch in/out output disable data v dd p-ch n-ch mask option input enable pull-up enable v dd p-ch in/out open drain output disable data v dd p-ch n-ch mask option
chapter 2 pin functions 46 user s manual u11302ej4v0um figure 2-1. pin i/o circuits (2/3) type 11 type 13-b type 13-d type 14-b type 14-a type 14 pull-up enable v dd p-ch in/out output disable data v dd p-ch n-ch p-ch comparator n-ch input enable v ref (threshold voltage) + v dd p-ch n-ch v dd p-ch data out v load v dd p-ch n-ch v dd p-ch data out v load mask option mask option v dd p-ch n-ch v dd p-ch data out data v dd n-ch p-ch in/out v dd output disable rd mask option middle-voltage input buffer data output disable in/out n-ch p-ch v dd rd middle-voltage input buffer
chapter 2 pin functions 47 user s manual u11302ej4v0um figure 2-1. pin i/o circuits (3/3) type 15-b type 15-c type 16 p-ch xt2 xt1 feedback cut-off v dd p-ch n-ch v dd p-ch data in/out v load mask option mask option rd n-ch v dd p-ch n-ch v dd p-ch data in/out rd n-ch
48 user? manual u11302ej4v0um chapter 3 cpu architecture 3.1 memory space each product of the pd780208 subseries accesses a memory space of 64 kb. figures 3-1 to 3-5 show memory maps. caution the initial values of the internal memory size switching register (ims) in the pd780204a, 780205a, and 78p0208 are fixed to cfh, regardless of the internal memory capacity. therefore, set the values shown below for each product before use. pd780204a: c8h pd780205a: cah pd78p0208: value corresponding to mask rom version figure 3-1. memory map ( pd780204 and pd780204a) 0000h data memory space internal rom 32768 x 8 bits 7fffh 1000h 0fffh 0800h 07ffh 0080h 007fh 0040h 003fh 0000h callf entry area callt table area program area program area internal high-speed ram 1024 x 8 bits reserved reserved program memory space 8000h 7fffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits vector table area fa30h fa2fh vfd display ram 80 x 8 bits fa80h fa7fh fac0h fabfh buffer ram 64 x 8 bits fb00h faffh fee0h fedfh ff00h feffh
chapter 3 cpu architecture 49 user s manual u11302ej4v0um figure 3-2. memory map ( pd780205 and pd780205a) 0000h data memory space internal rom 40960 x 8 bits 9fffh 1000h 0fffh 0800h 07ffh 0080h 007fh 0040h 003fh 0000h callf entry area callt table area program area program area internal high-speed ram 1024 x 8 bits reserved reserved program memory space a000h 9fffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits vector table area fa30h fa2fh vfd display ram 80 x 8 bits fa80h fa7fh fac0h fabfh buffer ram 64 x 8 bits fb00h faffh fee0h fedfh ff00h feffh
chapter 3 cpu architecture 50 user s manual u11302ej4v0um figure 3-3. memory map ( pd780206) data memory space special-function registers (sfrs) 256 x 8 bits general-purpose registers 32 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved vfd display ram 80 x 8 bits reserved internal expansion ram 1024 x 8 bits reserved internal rom 49152 x 8 bits program area callf entry area program area callt table area vector table area program memory space 0000h 0040h 003fh 0080h 007fh 0800h 07ffh 1000h 0fffh bfffh ffffh ff00h feffh fee0h fedfh fb00h faffh fac0h fabfh fa80h fa7fh fa30h fa2fh f800h f7ffh f400h f3ffh c000h bfffh 0000h
chapter 3 cpu architecture 51 user s manual u11302ej4v0um figure 3-4. memory map ( pd780208) data memory space special-function registers (sfrs) 256 x 8 bits general-purpose registers 32 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved vfd display ram 80 x 8 bits reserved internal expansion ram 1024 x 8 bits reserved internal rom 61440 x 8 bits program area callf entry area program area callt table area vector table area program memory space ffffh ff00h feffh fee0h fedfh fb00h faffh fac0h fabfh fa80h fa7fh fa30h fa2fh f800h f7ffh f400h f3ffh f000h efffh 0000h 0000h 0040h 003fh 0080h 007fh 0800h 07ffh 1000h 0fffh efffh
chapter 3 cpu architecture 52 user s manual u11302ej4v0um figure 3-5. memory map ( pd78p0208) 0000h data memory space internal prom 61440 x 8 bits efffh 1000h 0fffh 0800h 07ffh 0080h 007fh 0040h 003fh 0000h callf entry area callt table area program area program area internal high-speed ram 1024 x 8 bits reserved reserved program memory space f000h efffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits vector table area fa30h fa2fh vfd display ram 80 x 8 bits fa80h fa7fh fac0h fabfh buffer ram 64 x 8 bits fb00h faffh fee0h fedfh ff00h feffh internal expansion ram 1024 x 8 bits f800h f7ffh f400h f3ffh reserved
chapter 3 cpu architecture 53 user s manual u11302ej4v0um 3.1.1 internal program memory space the internal program memory space stores programs and table data. normally, this space is addressed using the program counter (pc). each product in the pd780208 subseries contains internal rom (or prom) with the capacity shown below. table 3-1. internal rom capacity the following areas are allocated to the internal program memory space. (1) vector table area the 64-byte area 0000h to 003fh is reserved as vector table area. program start addresses for branch upon reset input or interrupt request generation are stored in the vector table area. of the 16-bit address, the lower 8 bits are stored at even addresses and the higher 8 bits are stored at odd addresses. table 3-2. vector table vector table address interrupt source vector table address interrupt source 0000h reset input 0010h intcsi1 0004h intwdt 0012h inttm3 0006h intp0 0014h inttm0 0008h intp1 0016h inttm1 000ah intp2 0018h inttm2 000ch intp3 001ah intad 000eh intcsi0 001ch intks 003eh brk instruction (2) callt instruction table area the 64-byte area 0040h to 007fh can store the subroutine entry address of a 1-byte call instruction (callt). (3) callf instruction entry area the area 0800h to 0fffh can perform a direct subroutine call with a 2-byte call instruction (callf). internal rom configuration mask rom mask rom mask rom mask rom prom capacity 32768 x 8 bits 40960 x 8 bits 49152 x 8 bits 61440 x 8 bits 61440 x 8 bits part number pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208
chapter 3 cpu architecture 54 user s manual u11302ej4v0um 3.1.2 internal data memory space the pd780208 subseries units incorporate the following rams. (1) internal high-speed ram internal high-speed ram is allocated to the 1024-byte area from fb00h to feffh of the pd780208 subseries. four banks of general-purpose registers, each bank consisting of eight 8-bit registers are allocated in the 32- byte area fee0h to feffh. this area cannot be used as a program area in which instructions are written and executed. the internal high-speed ram can also be used as a stack memory. (2) internal expansion ram internal expansion ram is allocated to the 1024-byte area from f400h to f7ffh of the pd780206, 780208, and 78p0208. this area can also be used as a normal data area similar to the internal high-speed ram, as well as a program area in which instructions can be written and executed. the internal expansion ram cannot be used as a stack memory. (3) buffer ram buffer ram is allocated to the 64-byte area from fac0h to faffh. buffer ram is used for storing transmit/ receive data of serial interface channel 1 (3-wire serial i/o mode with automatic transmit/receive function). when not used in the 3-wire serial i/o mode with automatic transmit/receive function, buffer ram can be used as normal ram. (4) vfd display ram vfd display ram is allocated to the 80-byte area from fa30h to fa7fh. vfd display ram can also be used as normal ram. 3.1.3 special-function register (sfr) area on-chip peripheral hardware special-function registers (sfrs) are allocated to the area ff00h to ffffh (see table 3-3 special-function register list under 3.2.3 special-function registers (sfrs) ). caution do not access addresses where sfrs are not assigned.
chapter 3 cpu architecture 55 user s manual u11302ej4v0um 3.1.4 data memory addressing the method to specify the address of the instruction to be executed next or the address of a register or memory area to be manipulated when an instruction is executed is called addressing. the address of the instruction to be executed next is specified by the program counter (pc) (for details, refer to 3.3 instruction address addressing ). to address the memory area to be manipulated when an instruction is executed, the pd780208 subseries has many addressing modes to improve the operability. especially, in the areas to which the data memory is assigned (addresses fb00h to ffffh), the special-function registers (sfrs) and general-purpose registers can be addressed in accordance with thier function. data memory addressing is shown in figures 3-6 to 3-10. for details of each addressing, refer to 3.4 operand address addressing . figure 3-6. data memory addressing ( pd780204 and pd780204a) 0000h internal rom 32768 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved 8000h 7fffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits fac0h fabfh fb00h faffh fee0h fedfh ff00h feffh vfd display ram 80 x 8 bits fa80h fa7fh fa30h fa2fh reserved ff20h ff1fh direct addressing register indirect addressing based addressing based indexed addressing fe20h fe1fh sfr addressing register addressing short direct addressing
chapter 3 cpu architecture 56 user s manual u11302ej4v0um figure 3-7. data memory addressing ( pd780205 and pd780205a) 0000h internal rom 40960 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved a000h 9fffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits fb00h faffh fac0h fabfh fee0h fedfh ff00h feffh vfd display ram 80 x 8 bits fa80h fa7fh fa30h fa2fh reserved ff20h ff1fh direct addressing register indirect addressing based addressing based indexed addressing fe20h fe1fh sfr addressing register addressing short direct addressing
chapter 3 cpu architecture 57 user s manual u11302ej4v0um figure 3-8. data memory addressing ( pd780206) special-function registers (sfrs) 256 x 8 bits general-purpose registers 32 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved vfd display ram 80 x 8 bits reserved internal expansion ram 1024 x 8 bits reserved internal rom 49152 x 8 bits sfr addressing register addressing short direct addressing direct addressing register indirect addressing based addressing based indexed addressing ffffh ff20h ff1fh ff00h feffh fee0h fedfh fe20h fe1fh fb00h faffh fac0h fabfh fa80h fa7fh fa30h fa2fh f800h f7ffh f400h f3ffh c000h bfffh 0000h
chapter 3 cpu architecture 58 user s manual u11302ej4v0um figure 3-9. data memory addressing ( pd780208) special-function registers (sfrs) 256 x 8 bits general-purpose registers 32 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved vfd display ram 80 x 8 bits reserved internal expansion ram 1024 x 8 bits reserved internal rom 61440 x 8 bits sfr addressing register addressing short direct addressing direct addressing register indirect addressing based addressing based indexed addressing ffffh ff20h ff1fh ff00h feffh fee0h fedfh fe20h fe1fh fb00h faffh fac0h fabfh fa80h fa7fh fa30h fa2fh f800h f7ffh f400h f3ffh f000h efffh 0000h
chapter 3 cpu architecture 59 user s manual u11302ej4v0um figure 3-10. data memory addressing ( pd78p0208) 0000h internal prom 61440 x 8 bits internal high-speed ram 1024 x 8 bits buffer ram 64 x 8 bits reserved f000h efffh ffffh general-purpose registers 32 x 8 bits special-function registers (sfrs) 256 x 8 bits fb00h faffh fa30h fa2fh fee0h fedfh ff00h feffh internal expansion ram 1024 x 8 bits f800h f7ffh f400h f3ffh reserved ff20h ff1fh direct addressing register indirect addressing based addressing based indexed addressing fe20h fe1fh sfr addressing register addressing short direct addressing fa80h fa7fh fac0h fabfh vfd display ram 80 x 8 bits reserved
chapter 3 cpu architecture 60 user s manual u11302ej4v0um 3.2 processor registers the pd780208 subseries units incorporate the following processor registers. 3.2.1 control registers the control registers control the program sequence, statuses, and stack memory. the program counter (pc), program status word (psw), and stack pointer (sp) are control registers. (1) program counter (pc) the program counter is a 16-bit register which holds the address information of the next program to be executed. in normal operation, the pc is automatically incremented according to the number of bytes of the instruction to be fetched. when a branch instruction is executed, immediate data and register contents are set. reset input sets the reset vector table values at addresses 0000h and 0001h to the program counter. figure 3-11. program counter format (2) program status word (psw) the program status word is an 8-bit register consisting of various flags to be set/reset by instruction execution. program status word contents are automatically stacked upon interrupt request generation or push psw instruction execution and are automatically reset upon execution of the retb, reti, and pop psw instructions. reset input sets the psw to 02h. figure 3-12. program status word format (a) interrupt enable flag (ie) this flag controls interrupt request acknowledgment operations of the cpu. when ie = 0, the ie flag is set to the interrupt disabled (di) status. all interrupts except non-maskable interrupts are disabled. when ie = 1, the ie flag is set to the interrupt enabled (ei) status and interrupt request acknowledgment is controlled by an in-service priority flag (isp), an interrupt mask flag for each interrupt source, and a priority specification flag. this flag is reset to (0) upon di instruction execution or interrupt request acknowledgment and is set to (1) upon ei instruction execution. (b) zero flag (z) when the operation result is zero, this flag is set (1). it is reset (0) in all other cases. (c) register bank select flags (rbs0 and rbs1) these are 2-bit flags used to select one of the four register banks. in these flags, the 2-bit information which indicates the register bank selected by sel rbn instruction execution is stored. pc 15 0 pc15 pc13 pc12 pc11 pc10 pc9 pc8 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pc14 7 ie psw 0 z rbs1 ac rbs0 0 isp cy
chapter 3 cpu architecture 61 user s manual u11302ej4v0um (d) auxiliary carry flag (ac) if the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). it is reset (0) in all other cases. (e) in-service priority flag (isp) this flag manages the priority of acknowledgeable maskable vectored interrupts. when isp = 0, acknowledgment of a vectored interrupt request specified as lower priority by the priority specification flag registers (pr0l and pr0h) (refer to 16.3 (3) priority specification flag registers (pr0l, pr0h) ) is disabled. whether the interrupt request is actually acknowledged or not is controlled by the interrupt enable flag (ie). (f) carry flag (cy) this flag stores overflow and underflow upon add/subtract instruction execution. it stores the shift-out value upon rotate instruction execution and functions as a bit accumulator during bit manipulation instruction execution. (3) stack pointer (sp) this is a 16-bit register used to hold the start address of the memory stack area. only the internal high-speed ram area (fb00h to feffh) can be set as the stack area. figure 3-13. stack pointer format the sp is decremented ahead of write (save) to the stack memory and is incremented after read (reset) from the stack memory. each stack operation saves/resets data as shown in figures 3-14 and 3-15. caution because reset input makes sp contents undefined, be sure to initialize the sp before instruction execution. sp 15 0 sp15 sp13 sp12 sp11 sp10 sp9 sp8 sp7 sp6 sp5 sp4 sp3 sp2 sp1 sp0 sp14
chapter 3 cpu architecture 62 user s manual u11302ej4v0um figure 3-14. data to be saved to stack memory figure 3-15. data to be reset from stack memory interrupt and brk instruction call, callf, and callt instructions push rp instruction lower register pairs higher register pairs sp sp 2 sp 2 sp 1 sp sp sp 2 sp 2 sp 1 sp pc7 to pc0 pc15 to pc8 sp sp 3 sp 3 sp 2 sp 1 pc15 to pc8 psw sp pc7 to pc0 reti and retb instructions pc15 to pc8 psw pc7 to pc0 sp sp + 3 sp sp + 1 sp + 2 pc15 to pc8 pc7 to pc0 sp sp + 2 sp sp + 1 lower register pairs sp sp + 2 sp sp + 1 higher register pairs ret instruction pop rp instruction
chapter 3 cpu architecture 63 user s manual u11302ej4v0um 3.2.2 general-purpose registers general-purpose registers are mapped at particular addresses (fee0h to feffh) of the data memory. they consist of 4 banks, each bank consisting of eight 8-bit registers (x, a, c, b, e, d, l, and h). each register can be used as an 8-bit register, and two 8-bit registers can be used in pairs as a 16-bit register (ax, bc, de, and hl). they can be described in terms of function names (x, a, c, b, e, d, l, h, ax, bc, de, and hl) and absolute names (r0 to r7 and rp0 to rp3). register banks to be used for instruction execution are set using the cpu control instruction (sel rbn). because of the 4-register bank configuration, an efficient program can be created by switching between a register for normal processing and a register for interrupts for each bank. figure 3-16. general-purpose register configuration (a) absolute name (b) function name bank0 bank1 bank2 bank3 feffh fef8h fef0h fee8h fee0h rp3 rp2 rp1 rp0 r7 15 0 7 0 r6 r5 r4 r3 r2 r1 r0 16-bit processing 8-bit processing bank0 bank1 bank2 bank3 feffh fef8h fef0h fee8h fee0h hl de bc ax h 15 0 7 0 l d e b c a x 16-bit processing 8-bit processing
chapter 3 cpu architecture 64 user s manual u11302ej4v0um 3.2.3 special-function registers (sfrs) unlike a general-purpose register, each special-function register has a special function. the special-function registers are allocated in the ff00h to ffffh area. special-function registers can be manipulated, like general-purpose registers, with operation, transfer, and bit manipulation instructions. the manipulatable bit units, 1, 8, and 16, depend on the special-function register type. each manipulation bit unit can be specified as follows. 1-bit manipulation describe the symbol reserved in the assembler for the 1-bit manipulation instruction operand (sfr.bit). this manipulation can also be specified with an address. 8-bit manipulation describe the symbol reserved in the assembler for the 8-bit manipulation instruction operand (sfr). this manipulation can also be specified with an address. 16-bit manipulation describe the symbol reserved in the assembler for the 16-bit manipulation instruction operand (sfrp). when addressing an address, describe an even address. table 3-3 gives a list of special-function registers. the meaning of items in the table is as follows. symbol indicates symbols that specify the addresses of the special-function registers. the ra78k0 uses these symbols as reserved words, and the cc78k0 defines them in the header file sfrbit.h . symbols can be used as instruction operands if the ra78k0, id78k0, or sd78k0 is used. r/w indicates whether the corresponding special-function register can be read or written. r/w: read/write enable r: read only w: write only manipulatable bit units indicates manipulatable bit units (1, 8, and 16). indicates unmanipulatable bit units. after reset indicates each register status upon reset input.
chapter 3 cpu architecture 65 user s manual u11302ej4v0um table 3-3. special-function register list (1/3) address special-function register (sfr) name symbol r/w manipulatable bit unit 1 bit 8 bits 16 bits ff00h port 0 p0 r/w 00h ff01h port 1 p1 ff02h port 2 p2 ff03h port 3 p3 ff07h port 7 p7 ff08h port 8 p8 w ff09h port 9 p9 ff0ah port 10 p10 r/w ff0bh port 11 p11 ff0ch port 12 p12 ff10h 16-bit compare register cr00 undefined ff11h ff12h 16-bit capture register cr01 r ff13h ff14h 16-bit timer register tm0 0000h ff15h ff16h 8-bit compare register 10 cr10 r/w undefined ff17h 8-bit compare register 20 cr20 ff18h 8-bit timer register 1 tms tm1 r 00h ff19h 8-bit timer register 2 tms tm2 ff1ah serial i/o shift register 0 sio0 r/w undefined ff1bh serial i/o shift register 1 sio1 ff1fh a/d conversion result register adcr r ff20h port mode register 0 pm0 r/w 1fh ff21h port mode register 1 pm1 ffh ff22h port mode register 2 pm2 ff23h port mode register 3 pm3 ff27h port mode register 7 pm7 1fh ff2ah port mode register 10 pm10 ffh ff2bh port mode register 11 pm11 ff2ch port mode register 12 pm12 ff40h timer clock select register 0 tcl0 r/w 00h ff41h timer clock select register 1 tcl1 ff42h timer clock select register 2 tcl2 ff43h timer clock select register 3 tcl3 88h ff47h sampling clock select register scs 00h ff48h 16-bit timer mode control register tmc0 ff49h 8-bit timer mode control register tmc1 ff4ah watch timer mode control register tmc2 ff4eh 16-bit timer output control register toc0 ff4fh 8-bit timer output control register toc1 after reset tms
chapter 3 cpu architecture 66 user s manual u11302ej4v0um table 3-3. special-function register list (2/3) address special-function register (sfr) name symbol r/w manipulatable bit unit 1 bit 8 bits 16 bits ff60h serial operating mode register 0 csim0 r/w 00h ff61h serial bus interface control register sbic ff62h slave address register sva undefined ff63h interrupt timing specification register sint 00h ff68h serial operating mode register 1 csim1 ff69h automatic data transmit/receive control register adtc ff6ah automatic data transmit/receive address pointer adtp ff6bh automatic data transmit/receive interval specification adti register ff80h a/d converter mode register adm 01h ff84h a/d converter input select register adis 00h ffa0h display mode register 0 dspm0 ? note ffa1h display mode register 1 dspm1 ffa2h display mode register 2 dspm2 ffe0h interrupt request flag register 0l xxxx if0l ? ffe1h interrupt request flag register 0h xxxx if0h ffe4h interrupt mask flag register 0l xxx x mk0l ? ffh ffe5h interrupt mask flag register 0h mk0h ffe8h priority order specification flag register 0l pr0l ? ffe9h priority order specification flag register 0h xxxx pr0h ffech external interrupt mode register intm0 00h after reset if0 mk0 note only bit 7 can be manipulated, and only as a read operation. pr0
chapter 3 cpu architecture 67 user? manual u11302ej4v0um table 3-3. special-function register list (3/3) address special-function register (sfr) name symbol r/w manipulatable bit unit 1 bit 8 bits 16 bits fff0h internal memory size switching register ims r/w note fff4h internal expansion ram size switching register ixs w note fff7h pull-up resistor option register puo r/w ?0h fff9h watchdog timer mode register wdtm fffah oscillation stabilization time select register osts ?4h fffbh processor clock control register pcc note the value after resetting the internal memory size switching register (ims) and internal expansion ram size switching register (ixs) depends on the product. pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208 ims c8h cfh cah cfh cch cfh cfh ixs none 0ah when using the pd780204, 780205, 780206, and 780208, do not set any value other than that of ims and ixs after reset. when using the pd780204a, 780205a, and 78p0208, the initial values of ims are fixed to cfh, regardless of the internal memory capacity. therefore, set the values shown below for each product before use. pd780204a: c8h pd780205a: cah pd78p0208: value corresponding to mask rom version after reset
chapter 3 cpu architecture 68 user s manual u11302ej4v0um 3.3 instruction address addressing an instruction address is determined by program counter (pc) contents. the pc contents are normally incremented (+1 for each byte) automatically according to the number of bytes of the instruction to be fetched each time another instruction is executed. when a branch instruction is executed, the branch destination information is set to the pc and the program is branched by the following addressing (for details of instructions, refer to the 78k/0 series instructions user? manual (u12326e) ). 3.3.1 relative addressing [function] the value obtained by adding 8-bit immediate data (displacement value: jdisp8) of an instruction code to the start address of the following instruction is transferred to the program counter (pc) and branched. the displacement value is treated as signed two s complement data ( 128 to +127) and bit 7 becomes a sign bit. in other words, the range of branch in relative addressing is between 128 and +127 of the start address of the following instruction. this function is carried out when the br $addr16 instruction or a conditional branch instruction is executed. [illustration] 15 0 pc + 15 0 876 s 15 0 pc jdisp8 when s = 0, all bits of are 0. when s = 1, all bits of are 1. pc indicates the start address of the instruction after the br instruction. ...
chapter 3 cpu architecture 69 user s manual u11302ej4v0um 3.3.2 immediate addressing [function] immediate data in the instruction word is transferred to the program counter (pc) and branched. this function is carried out when the call !addr16 or br !addr16 or callf !addr11 instruction is executed. call !addr16 and br !addr16 instructions can branch to all the memory spaces. callf !addr11 instruction branches to the area from 0800h to 0fffh. [illustration] in the case of call !addr16 and br !addr16 instructions in the case of callf !addr11 instruction 15 0 pc 87 70 call or br low addr. high addr. 15 0 pc 87 70 fa 10 8 11 10 00001 643 callf fa 7 0
chapter 3 cpu architecture 70 user s manual u11302ej4v0um 3.3.3 table indirect addressing [function] table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the immediate data of an operation code are transferred to the program counter (pc) and branched. table indirect addressing is carried out when the callt [addr5] instruction is executed. this instruction can refer to the address stored in the memory table 40h to 7fh and branch to all the memory spaces. [illustration] 15 1 15 0 pc 70 low addr. high addr. memory (table) effective address + 1 effective address 01 00000000 87 87 65 0 0 1 11 765 10 ta 4 _ 0 operation code
chapter 3 cpu architecture 71 user s manual u11302ej4v0um 3.3.4 register addressing [function] register pair (ax) contents to be specified with an instruction word are transferred to the program counter (pc) and branched. this function is carried out when the br ax instruction is executed. [illustration] 70 rp 07 ax 15 0 pc 87
chapter 3 cpu architecture 72 user s manual u11302ej4v0um 3.4 operand address addressing the following methods are available to specify the register and memory (addressing) which undergo manipulation during instruction execution. 3.4.1 implied addressing [function] the register which functions as an accumulator (a and ax) in the general-purpose register area is automatically (implicitly) addressed. of the pd780208 subseries instruction words, the following instructions employ implied addressing. instruction register to be specified by implied addressing mulu register a for multiplicand and register ax for product storage divuw register ax for dividend and quotient storage adjba/adjbs register a for storage of numeric values subject to decimal adjustment ror4/rol4 register a for storage of digit data which undergoes digit rotation [operand format] because implied addressing can be automatically employed with an instruction, no particular operand format is necessary. [description example] in the case of mulu x with an 8-bit x 8-bit multiply instruction, the product of register a and register x is stored in ax. in this example, the a and ax registers are specified by implied addressing.
chapter 3 cpu architecture 73 user s manual u11302ej4v0um 3.4.2 register addressing [function] a general-purpose register is accessed as an operand. the general-purpose register to be accessed is specified by register bank select flags (rbs0 and rbs1) and the register specification code (rn, rpn) in the operation code. register addressing is carried out when an instruction with the following operand format is executed. when an 8-bit register is specified, one of the eight registers is specified with 3 bits in the operation code. [operand format] identifier description r x, a, c, b, e, d, l, h rp ax, bc, de, hl r and rp can be described using function names (x, a, c, b, e, d, l, h, ax, bc, de, and hl) as well as absolute names (r0 to r7 and rp0 to rp3). [description example] mov a, c; when selecting c register as r incw de; when selecting de register pair as rp operation code 01100010 operation code 10000100 register specification code register specification code
chapter 3 cpu architecture 74 user s manual u11302ej4v0um 3.4.3 direct addressing [function] the memory indicated by immediate data in an instruction word is directly addressed. [operand format] identifier description addr16 label or 16-bit immediate data [description example] mov a, !0fe00h; when setting !addr16 to fe00h [illustration] operation code 10001110 00000000 11111110 opcode 00h feh 70 addr16 (lower) opcode memory addr16 (lower)
chapter 3 cpu architecture 75 user s manual u11302ej4v0um 3.4.4 short direct addressing [function] the memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word. the fixed space to which this addressing is applied to is the 256-byte space from fe20h to ff1fh. an internal high-speed ram and special-function registers (sfrs) are mapped at fe20h to feffh and ff00h to ff1fh, respectively. the sfr area (ff00h to ff1fh) where short direct addressing is applied is a part of the total sfr area. in this area, ports which are frequently accessed in a program and compare and capture registers of the timer/event counter are mapped and these sfrs can be manipulated with a small number of bytes and clocks. when 8-bit immediate data is at 20h to ffh, bit 8 of an effective address is set to 0. when it is at 00h to 1fh, bit 8 is set to 1. refer to [illustration] below. [operand format] identifier description saddr label or immediate data indicating fe20h to ff1fh saddrp label or immediate data indicating fe20h to ff1fh (even address only) [description example] mov 0fe30h, #50h; when setting saddr to fe30h and immediate data to 50h [illustration] operation code 00010001 00110000 01010000 15 0 70 opcode saddr-offset effective address 8 when 8-bit immediate data is 20h to ffh, = 0 1111111 short direct memory when 8-bit immediate data is 00h to 1fh, = 1 opcode 30h (saddr-offset) 50h (immediate data)
chapter 3 cpu architecture 76 user s manual u11302ej4v0um 3.4.5 special-function register (sfr) addressing [function] a memory-mapped special-function register (sfr) is addressed with 8-bit immediate data in an instruction word. this addressing is applied to the 240-byte spaces ff00h to ffcfh and ffe0h to ffffh. however, the sfrs mapped at ff00h to ff1fh can be accessed with short direct addressing. [operand format] identifier description sfr special-function register name sfrp 16-bit manipulatable special-function register name (even address only) [description example] mov pm0, a; when selecting pm0 (ff20h) as sfr [illustration] operation code 11110110 00100000 15 0 70 opcode sfr-offset effective address 8 1111111 7 1 sfr opcode 20h (sfr-offset)
chapter 3 cpu architecture 77 user s manual u11302ej4v0um 3.4.6 register indirect addressing [function] the memory is addressed with the contents of the register pair specified as an operand. the register pair to be accessed is specified with the register bank select flag (rbs0 and rbs1) and the register pair specification code in the instruction code. this addressing can be carried out for all the memory spaces. [operand format] identifier description [de], [hl] [description example] mov a, [de]; when selecting [de] as register pair [illustration] operation code 10000101 15 0 7 8 de 70 a 0 7 de the contents of addressed memory are transferred memory address specified by register pair de memory
chapter 3 cpu architecture 78 user s manual u11302ej4v0um 3.4.7 based addressing [function] 8-bit immediate data is added to the contents of the base register, that is, the hl register pair, and the sum is used to address the memory. the hl register pair to be accessed is in the register bank specified with the register bank select flags (rbs0 and rbs1). addition is performed by expanding the offset data as a positive number to 16 bits. a carry from the 16th bit is ignored. this addressing can be carried out for all the memory spaces. [operand format] identifier description [hl+byte] [description example] mov a, [hl+10h]; when setting byte to 10h operation code 10101110 00010000
chapter 3 cpu architecture 79 user s manual u11302ej4v0um 3.4.8 based indexed addressing [function] the b or c register contents specified in an instruction word are added to the contents of the base register, that is, the hl register pair, and the sum is used to address the memory. the hl, b, and c registers to be accessed are registers in the register bank specified with the register bank select flag (rbs0 and rbs1). addition is performed by expanding the contents of the b or c register as a positive number to 16 bits. a carry from the 16th bit is ignored. this addressing can be carried out for all the memory spaces. [operand format] identifier description [hl+b], [hl+c] [description example] in the case of mov a, [hl+b] (select b register) 3.4.9 stack addressing [function] the stack area is indirectly addressed with the stack pointer (sp) contents. this addressing method is automatically employed when the push, pop, subroutine call, and return instructions are executed or the register is saved/reset upon generation of an interrupt request. stack addressing can be used to address the internal high-speed ram area only. [description example] in the case of push de (save de register) operation code 10101011 operation code 10110101
80 user? manual u11302ej4v0um chapter 4 port functions 4.1 port functions the pd780208 subseries units incorporate two input ports, 16 output ports, and 56 i/o ports. figure 4-1 shows the port configuration. every port is capable of 1-bit and 8-bit manipulations and can carry out various control operations. besides port functions, the ports can also serve as on-chip hardware i/o pins. figure 4-1. port types port 9 p90 p97 p100 p107 p110 p117 p120 p127 p04 p10 p17 p20 p27 p30 p37 p70 p74 p00 p80 p87 port 10 port 11 port 12 port 1 port 0 port 2 port 3 port 7 port 8
chapter 4 port functions 81 user s manual u11302ej4v0um table 4-1. port functions (1/2) pin name function alternate function p00 input only. intp0/ti0 p01 intp1 p02 intp2 p03 intp3 p04 input only. xt1 p10 to p17 port 1. ani0 to ani7 8-bit i/o port. input/output can be specified in 1-bit units. if used as an input port, on-chip pull-up resistors can be used by software settings. p20 si1 p21 so1 p22 sck1 p23 stb p24 busy p25 si0/sb0 p26 so0/sb1 p27 sck0 p30 to0 p31 to1 p32 to2 p33 ti1 p34 ti2 p35 pcl p36 buz p37 p70 to p74 port 7. n-ch open-drain 5-bit i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of pull-up resistors can be specified in 1-bit units with the mask option. p80 to p87 port 8. fip13 to fip20 p-ch open-drain 8-bit high withstanding voltage output port. leds can be driven directly. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option (can be specified as connected to v load or v ss in 4-bit units). p90 to p97 port 9. fip21 to fip28 p-ch open-drain 8-bit high withstanding voltage output port. leds can be driven directly. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option (can be specified as connected to v load or v ss in 4-bit units). input/output can be specified in 1-bit units. if used as an input port, on-chip pull-up resistors can be used by software settings. port 0. 5-bit i/o port. port 2. 8-bit i/o port. input/output can be specified in 1-bit units. if used as an input port, on-chip pull-up resistors can be used by software settings. port 3. 8-bit i/o port. input/output can be specified in 1-bit units. leds can be driven directly. if used as an input port, on-chip pull-up resistors can be used by software settings. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option.
chapter 4 port functions 82 user s manual u11302ej4v0um table 4-1. port functions (2/2) alternate pin name function function p100 to p107 port 10. fip29 to fip36 p-ch open-drain 8-bit high withstanding voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option (can be specified as connected to v load or v ss in 4-bit units). p110 to p117 port 11. fip37 to fip44 p-ch open-drain 8-bit high withstanding voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option (can be specified as connected to v load or v ss in 4-bit units). p120 to p127 port 12. fip45 to fip52 p-ch open-drain 8-bit high withstanding voltage i/o port. input/output can be specified in 1-bit units. leds can be driven directly. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option (can be specified as connected to v load or v ss in 4-bit units).
chapter 4 port functions 83 user s manual u11302ej4v0um 4.2 port configuration a port consists of the following hardware. table 4-2. port configuration item configuration control registers port mode register (pmm: m = 0, 1, 2, 3, 7, 10, 11, 12) pull-up resistor option register (puo) ports total: 74 (2 input, 16 output, 56 i/o) pull-up resistors mask rom versions total: 32 (software control: 27, mask option control: 5) pd78p0208 ... total: 27 pull-down resistors mask rom versions ... total: 48 (mask option control: 48) 4.2.1 port 0 port 0 is a 5-bit i/o port with an output latch. the p01 to p03 pins can be set to input mode/output mode in 1- bit units using port mode register 0 (pm0). the p00 and p04 pins are input-only port pins. when the p01 to p03 pins are used as input port pins, on-chip pull-up resistors can be connected to them in 3-bit units using the pull- up resistor option register (puo). alternate functions include external interrupt request input, external count clock input to the timer, and crystal connection for subsystem clock oscillation. reset input sets port 0 to input mode. figures 4-2 and 4-3 show block diagrams of port 0. caution because port 0 can also be used for external interrupt request input, when the port function output mode is specified and the output level is changed, the interrupt request flag is set. thus, when the output mode is used, set the interrupt mask flag to 1.
chapter 4 port functions 84 user s manual u11302ej4v0um figure 4-2. block diagram of p00 and p04 figure 4-3. block diagram of p01 to p03 puo: pull-up resistor option register pm: port mode register rd: port 0 read signal wr: port 0 write signal p00/intp0/ti0, p04/xt1 rd internal bus p-ch wr pm wr port rd wr puo v dd p01/intp1, p02/intp2, p03/intp3 selector puo0 output latch (p01 to p03) pm01 to pm03 internal bus
chapter 4 port functions 85 user s manual u11302ej4v0um 4.2.2 port 1 port 1 is an 8-bit i/o port with an output latch. the p10 to p17 pins can be set to input mode/output mode in 1-bit units using port mode register 1 (pm1). when the p10 to p17 pins are used as input port pins, on-chip pull- up resistors can be connected to them in 8-bit units using the pull-up resistor option register (puo). alternate functions include a/d converter analog input. reset input sets port 1 to input mode. figure 4-4 shows a block diagram of port 1. caution a pull-up resistor cannot be connected to pins used for a/d converter analog input. figure 4-4. block diagram of p10 to p17 puo: pull-up resistor option register pm: port mode register rd: port 1 read signal wr: port 1 write signal p-ch wr pm wr port rd wr puo v dd p10/ani0 to p17/ani7 selector puo1 output latch (p10 to p17) pm10 to pm17 internal bus
chapter 4 port functions 86 user s manual u11302ej4v0um 4.2.3 port 2 port 2 is an 8-bit i/o port with an output latch. the p20 to p27 pins can be set to input mode/output mode in 1-bit units using port mode register 2 (pm2). when the p20 to p27 pins are used as input port pins, on-chip pull- up resistors can be connected to them in 8-bit units using the pull-up resistor option register (puo). alternate functions include serial interface data i/o, clock i/o, automatic transmit/receive busy input, and strobe output. reset input sets port 2 to input mode. figures 4-5 and 4-6 show block diagrams of port 2. cautions 1. if used as serial interface pins, set the i/o and output latch according to each function. refer to figure 13-3 format of serial operating mode register 0 and figure 14-3 format of serial operating mode register 1 for the settings. 2. when reading the pin state in sbi mode, set the pm2n bit of pm2 to 1 (n = 5, 6) (refer to the description of (10) judging busy status of slave in 13.4.3 sbi mode operation). figure 4-5. block diagram of p20, p21, p23 to p26 puo: pull-up resistor option register pm: port mode register rd: port 2 read signal wr: port 2 write signal p-ch wr pm wr port rd wr puo v dd p20/si1, p21/so1, p23/stb, p24/busy, p25/si0/sb0, p26/so0/sb1 selector puo2 output latch (p20, p21, p23 to p26) pm20, pm21, pm23 to pm26 alternate function internal bus
chapter 4 port functions 87 user s manual u11302ej4v0um figure 4-6. block diagram of p22 and p27 puo: pull-up resistor option register pm: port mode register rd: port 2 read signal wr: port 2 write signal p-ch wr pm wr port rd wr puo v dd p22/sck1, p27/sck0 selector puo2 output latch (p22, p27) pm22, pm27 alternate function internal bus
chapter 4 port functions 88 user s manual u11302ej4v0um 4.2.4 port 3 port 3 is an 8-bit i/o port with an output latch. the p30 to p37 pins can be set to input mode/output mode in 1-bit units using port mode register 3 (pm3). when the p30 to p37 pins are used as input port pins, on-chip pull- up resistors can be connected to them in 8-bit units using the pull-up resistor option register (puo). in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. the pd78p0208 does not contain pull-down resistors. port 3 can drive leds directly. alternate functions include timer i/o, clock output, and buzzer output. reset input sets port 3 to input mode. figure 4-7 shows a block diagram of port 3. figure 4-7. block diagram of p30 to p37 puo: pull-up resistor option register pm: port mode register rd: port 3 read signal wr: port 3 write signal p-ch wr pm wr port rd wr puo v dd only mask rom versions. the pd78p0208 has no pull-down resistors. selector puo3 output latch (p30 to p37) pm30 to pm37 alternate function internal bus p30/to0 to p32/to2, p33/ti1, p34/ti2, p35/pcl, p36/buz, p37 mask option
chapter 4 port functions 89 user s manual u11302ej4v0um 4.2.5 port 7 port 7 is a 5-bit i/o port with an output latch. the p70 to p74 pins can be set to input mode/output mode in 1- bit units using port mode register 7 (pm7). in mask rom versions, use of pull-up resistors can be specified in 1- bit units with the mask option. the pd78p0208 does not contain pull-up resistors. port 7 can drive leds directly. reset input sets port 7 to input mode. figure 4-8 shows a block diagram of port 7. caution the low-level input leak current flowing to the p70 to p74 pins varies depending on the following conditions. [for mask rom version] ?when a pull-up resistor is connected: ?? a (max.) regardless of operational conditions ?when a pull-up resistor is not connected: ?00 a (max.) during 1.5 clock cycles after read instruction execution to port 7 (p7) or port mode register 7 (pm7) ?? a (max.) under other conditions [for prom version] ?00 a (max.) during 1.5 clock cycles after read instruction execution to port 7 (p7) or port mode register 7 (pm7) ?? a (max.) under other conditions figure 4-8. block diagram of p70 to p74 pm: port mode register rd: port 7 read signal wr: port 7 write signal internal bus output latch (p70 to p74) wr port pm70 to pm74 wr pm selector rd v dd only mask rom versions. the pd78p0208 has no pull-up resistors. mask option p70 to p74
chapter 4 port functions 90 user s manual u11302ej4v0um 4.2.6 port 8 port 8 is an 8-bit output-only port. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. pull-down resistor connection to v load or v ss can be specified in 4-bit units. the pd78p0208 does not contain pull-down resistors. port 8 can drive leds directly. alternate functions include vfd controller/driver display output. reset input sets port 8 to output mode. figure 4-9 shows a block diagram of port 8. caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. figure 4-9. block diagram of p80 to p87 wr: port 8 write signal internal bus output latch (p80 to p87) wr port alternate function mask option p80/fip13 to p87/fip20 v load p-ch open-drain only mask rom versions. the pd78p0208 has no pull-down resistors.
chapter 4 port functions 91 user s manual u11302ej4v0um 4.2.7 port 9 port 9 is an 8-bit output-only port. in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. pull-down resistor connection to v load or v ss can be specified in 4-bit units. the pd78p0208 does not contain pull-down resistors. port 9 can drive leds directly. alternate functions include vfd controller/driver display output. reset input sets port 9 to output mode. figure 4-10 shows a block diagram of port 9. caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. figure 4-10. block diagram of p90 to p97 wr: port 9 write signal internal bus output latch (p90 to p97) wr port alternate function mask option p90/fip21 to p97/fip28 v load p-ch open-drain only mask rom versions. the pd78p0208 has no pull-down resistors.
chapter 4 port functions 92 user s manual u11302ej4v0um 4.2.8 port 10 port 10 is an 8-bit i/o port with an output latch. the p100 to p107 pins can be set to input mode/output mode in 1-bit units using port mode register 10 (pm10). in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. pull-down resistor connection to v load or v ss can be specified in 4-bit units. the pd78p0208 does not contain pull-down resistors. port 10 can drive leds directly. alternate functions include vfd controller/driver display output. reset input sets port 10 to input mode. figure 4-11 shows a block diagram of port 10. caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. figure 4-11. block diagram of p100 to p107 rd wr port internal bus wr pm selector output latch (p100 to p107) pm100 to pm107 alternate function p100/fip29 to p107/fip36 v load mask option only mask rom versions. the pd78p0208 has no pull-down resistors. pm: rd: wr: port mode register port 10 read signal port 10 write signal
chapter 4 port functions 93 user s manual u11302ej4v0um 4.2.9 port 11 port 11 is an 8-bit i/o port with an output latch. the p110 to p117 pins can be set to input mode/output mode in 1-bit units using port mode register 11 (pm11). in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. pull-down resistor connection to v load or v ss can be specified in 4-bit units. the pd78p0208 does not contain pull-down resistors. port 11 can drive leds directly. alternate functions include vfd controller/driver display output. reset input sets port 11 to input mode. figure 4-12 shows a block diagram of port 11. caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. figure 4-12. block diagram of p110 to p117 pm: port mode register rd: port 11 read signal wr: port 11 write signal internal bus wr port pm110 to pm117 wr pm selector rd mask option p110/fip37 to p117/fip44 alternate function v load only mask rom versions. the pd78p0208 has no pull-down resistors. output latch (p110 to p117)
chapter 4 port functions 94 user s manual u11302ej4v0um 4.2.10 port 12 port 12 is an 8-bit i/o port with an output latch. the p120 to p127 pins can be set to input mode/output mode in 1-bit units using port mode register 12 (pm12). in mask rom versions, use of pull-down resistors can be specified in 1-bit units with the mask option. pull-down resistor connection to v load or v ss can be specified in 4-bit units. the pd78p0208 does not contain pull-down resistors. port 12 can drive leds directly. alternate functions include vfd controller/driver display output. reset input sets port 12 to input mode. figure 4-13 shows a block diagram of port 12. caution adjust the number of pull-down resistors so that the total power dissipation (refer to 15.10 calculating total power dissipation) is not exceeded. figure 4-13. block diagram of p120 to p127 pm: port mode register rd: port 12 read signal wr: port 12 write signal internal bus output latch (p120 to p127) wr port pm120 to pm127 wr pm selector rd mask option p120/fip45 to p127/fip52 alternate function v load only mask rom versions. the pd78p0208 has no pull-down resistors.
chapter 4 port functions 95 user s manual u11302ej4v0um 4.3 port function control registers the following two types of registers control the ports. port mode registers (pm0, pm1, pm2, pm3, pm7, pm10, pm11, pm12) pull-up resistor option register (puo) (1) port mode registers (pm0, pm1, pm2, pm3, pm7, pm10, pm11, pm12) these registers are used to set port input/output in 1-bit units. pm0, pm1, pm2, pm3, pm7, pm10, pm11, and pm12 are independently set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pm0 and pm7 to 1fh, and the other registers to ffh. when a port pin is used as an alternate-function pin, set the port mode register and the output latch according to table 4-3. cautions 1. pins p00 and p04 are input-only pins. 2. pins p80 to p87 and p90 to p97 are output-only pins. 3. as port 0 has an alternate function as external interrupt request input, when the port function output mode is specified and the output level is changed, the interrupt request flag is set. when the output mode is used, therefore, the interrupt mask flag should be set to 1 beforehand. table 4-3. port mode register and output latch setting when alternate function is used pin name alternate function pmxx pxx pin name alternate function pmxx pxx p00 intp0 input 1 (fixed) none p33, p34 ti1, ti2 input 1 x ti0 input 1 (fixed) none p35 pcl output 0 0 p01, p02 intp1, intp2 input 1 x p36 buz output 0 0 p03 intp3 input 1 x p100 to p107 fip29 to fip36 output 0 0 note 2 p04 note 1 xt1 input 1 (fixed) none p110 to p117 fip37 to fip44 output 0 0 note 2 p10 to p17 ani0 to ani7 input 1 x p120 to p127 fip45 to fip52 output 0 0 note 2 p30 to p32 to0 to to2 output 0 0 notes 1. if a read instruction is executed to these ports in the alternate-function mode, the read data will be undefined. 2. key scan data can be set while the vfd controller/driver is operating. caution when port 2 is used as serial interface pins, i/o and the output latch should be set according to the function. for the settings, refer to figure 13-3 format of serial operating mode register 0 and figure 14-3 format of serial operating mode register 1. remark x: don t care pmxx: port mode register pxx: port output latch note 1 i/o i/o function name function name
chapter 4 port functions 96 user s manual u11302ej4v0um figure 4-14. format of port mode register pm0 pm1 pm2 pm37 0 pm127 pm126 pm125 pm124 pm123 pm122 pm121 pm120 0 0 1 pm03 pm02 pm01 1 76543210 symbol pm16 pm15 pm14 pm13 pm12 pm11 pm26 pm25 pm24 pm23 pm22 pm21 pm36 pm35 pm34 pm33 pm32 pm31 pm17 pm10 pm27 pm3 pm20 pm30 pm12 pmmn pmn pin i/o mode selection (m = 0, 1, 2, 3, 7, 10, 11, 12 : n = 0 to 7) 0 1 output mode (output buffer on) input mode (output buffer off) ff20h ff2ch ff21h ff22h ff23h 1fh ffh ffh ffh ffh r/w r/w r/w r/w r/w address after reset r/w 0 pm72 pm71 0 0 pm74 pm73 pm70 pm7 ff27h 1fh r/w pm117 pm116 pm115 pm114 pm113 pm112 pm111 pm110 pm11 ff2bh ffh r/w pm107 pm102 pm101 pm106 pm105 pm104 pm103 pm100 pm10 ff2ah ffh r/w
chapter 4 port functions 97 user s manual u11302ej4v0um (2) pull-up resistor option register (puo) the puo register enables or disables the on-chip pull-up resistor for each port pin. to enable the on-chip pull- up resistor of a port pin, the pin must be in the input mode and the corresponding bit in the puo register must be set to 1. for any pin specified as output mode or used as an analog input pin, the on-chip pull-up resistors cannot be used, regardless of the puo register setting. puo is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets this register to 00h. cautions 1. the p00 and p04 pins do not incorporate a pull-up resistor. 2. when port 1 is used as analog input for the a/d converter, an on-chip pull-up resistor cannot be used even if 1 is set in puo1. figure 4-15. format of pull-up resistor option register puo 0 puom pm on-chip pull-up resistor selection (m = 0, 1, 2, 3) 0 1 on-chip pull-up resistor not used on-chip pull-up resistor used fff7h 00h r/w symbol 765 4 <3> <2> <0> <1> 0 0 0 puo3 puo2 puo1 puo0 address after reset r/w
chapter 4 port functions 98 user s manual u11302ej4v0um 4.4 port function operations port operations differ depending on whether the input or output mode is set, as shown below. 4.4.1 writing to i/o port (1) output mode a value is written to the output latch by a transfer instruction, and the output latch contents are output from the pin. once data is written to the output latch, it is retained until data is written to the output latch again. (2) input mode a value is written to the output latch by a transfer instruction, but since the output buffer is off, the pin status does not change. once data is written to the output latch, it is retained until data is written to the output latch again. caution in the case of a 1-bit memory manipulation instruction, although a single bit is manipulated, the port is accessed in 8-bit units. therefore, on a port with a mixture of input and output pins, the output latch contents for pins specified as input are undefined except for the manipulated bit. 4.4.2 reading from i/o port (1) output mode the output latch contents are read by a transfer instruction. the output latch contents do not change. (2) input mode the pin status is read by a transfer instruction. the output latch contents do not change. 4.4.3 operations on i/o port (1) output mode an operation is performed on the output latch contents, and the result is written to the output latch. the output latch contents are output from the pins. once data is written to the output latch, it is retained until data is written to the output latch again. (2) input mode the output latch contents become undefined. however, the pin status does not change because the output buffer is turned off. caution in the case of a 1-bit memory manipulation instruction, although a single bit is manipulated, the port is accessed in 8-bit units. therefore, on a port with a mixture of input and output pins, the output latch contents for pins specified as input are undefined except for the manipulated bit.
chapter 4 port functions 99 user? manual u11302ej4v0um 4.5 selection of mask option the following mask option is provided in mask rom versions. the pd78p0208 has no mask option. table 4-4. comparison between mask option of mask rom version and pd78p0208 pin name mask option of mask rom version pd78p0208 can incorporate pull-down resistors in 1-bit units. can incorporate pull-up resistors in 1-bit units. can incorporate pull-down resistors in 1-bit units. can incorporate pull-down resistors in 1-bit units. the pull-down resistors can be specified to be connected to v load or v ss in 4-bit units from p80. does not incorporate pull-down resistors. does not incorporate pull-up resistors. incorporates pull-down resistors (connected to v load ). does not incorporate pull-down resistors. p30/to0 to p32/to2, p33/ ti1, p34/ti2, p35/pcl, p36/ buz, p37 p70 to p74 fip0 to fip12 p80/fip13 to p87/fip20, p90/fip21 to p97/fip28, p100/fip29 to p107/fip36, p110/fip37 to p117/fip44, p120/fip45 to p127/fip52
100 user? manual u11302ej4v0um chapter 5 clock generator 5.1 clock generator functions the clock generator generates the clock to be supplied to the cpu and peripheral hardware. the following two types of system clock oscillators are available. (1) main system clock oscillator this circuit oscillates at frequencies of 1 to 5.0 mhz. oscillation can be stopped by executing the stop instruction or setting the processor clock control register (pcc). (2) subsystem clock oscillator the circuit oscillates at a frequency of 32.768 khz. oscillation cannot be stopped. if the subsystem clock oscillator is not used, the internal feedback resistor can be disabled by the processor clock control register (pcc). this decreases the power consumption in the stop mode. the noise eliminator operates automatically to reduce the effect of switching noise during vfd display. 5.2 clock generator configuration the clock generator consists of the following hardware. table 5-1. clock generator configuration item configuration control registers processor clock control register (pcc) display mode register 0 (dspm0) display mode register 1 (dspm1) oscillator main system clock oscillator subsystem clock oscillator
chapter 5 clock generator 101 user? manual u11302ej4v0um figure 5-1. clock generator block diagram notes 1. bit 6 of display mode register 0 (dspm0) 2. bits 4 to 7 of display mode register 1 (dspm1) subsystem clock oscillator f xt xt2 xt1/p04 frc selector clock output function main system clock oscillator x2 x1 f x stop mcc frc cls css pcc2 pcc1 pcc0 processor clock control register internal bus standby controller cpu clock (f cpu ) 2 f x 2 2 f x 2 3 f x 2 4 f x prescaler clock to peripheral hardware 3 to intp0 sampling clock prescaler noise eliminator digs0 to digs3 note 2 dspm06 note 1 f x /8 f x /16 watch timer selector watchdog timer f x selector 1/2 2 f xt
chapter 5 clock generator 102 user s manual u11302ej4v0um 5.3 clock generator control registers the clock generator is controlled by the following three registers. processor clock control register (pcc) display mode register 0 (dspm0) display mode register 1 (dspm1) (1) processor clock control register (pcc) pcc sets cpu clock selection, the ratio of division, main system clock oscillator operation/stop, and subsystem clock oscillator internal feedback resistor enable/disable. pcc is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pcc to 04h. figure 5-2. feedback resistor of subsystem clock xt1 xt2 p-ch frc
chapter 5 clock generator 103 user s manual u11302ej4v0um figure 5-3. format of processor clock control register notes 1. bit 5 is a read-only bit. 2. this bit can be set to 1 only when the subsystem clock is not used. 3. when the cpu is operating on the subsystem clock, mcc should be used to stop the main system clock oscillation. the stop instruction should not be used. cautions 1. bit 3 must be set to 0. 2. do not set mcc while an external clock is being input. this is because the x2 pin is pulled up to v dd . remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency pcc0 pcc <7> <6> <5> <4> 3 2 symbol 10 css cpu clock (f cpu ) selection fffbh pcc1 0 pcc2 css cls frc mcc address after reset r/w 04h r/w note 1 f x f x /2 f x /2 2 f x /2 3 f x /2 4 f xt /2 other than above setting prohibited cls cpu clock status 0 main system clock 1 subsystem clock frc subsystem clock feedback resistor selection 0 internal feedback resistor used 1 internal feedback resistor not used note 2 mcc main system clock oscillation control note 3 0 oscillation possible 1 oscillation stopped pcc2 0 0 0 0 1 0 0 1 0 1 pcc1 0 0 1 1 0 0 0 1 1 0 pcc0 0 1 0 1 0 0 1 0 1 0 0 0 r/w r r/w r/w
chapter 5 clock generator 104 user s manual u11302ej4v0um the fastest instruction of the pd780208 subseries is executed in two cpu clocks. therefore, the relationship between the cpu clock (f cpu ) and minimum instruction execution time is as shown in table 5-2. table 5-2. relationship between cpu clock and minimum instruction execution time cpu clock (f cpu ) minimum instruction execution time: 2/f cpu f x 0.4 s f x /2 0.8 s f x /2 2 1.6 s f x /2 3 3.2 s f x /2 4 6.4 s f xt /2 122 s f x = 5.0 mhz, f xt = 32.768 khz f x : main system clock oscillation frequency f xt : subsystem clock oscillation frequency (2) display mode register 0 (dspm0) this register sets the mode for the noise eliminator of the subsystem clock. dspm0 is set with an 8-bit memory manipulation instruction. only bit 7 (ksf) can be read with a 1-bit memory manipulation instruction. reset input sets dspm0 to 00h. remark in addition to the function mentioned above, dspm0 can also set the number of display segments/ total number of display outputs, display mode, and display key scan timing.
chapter 5 clock generator 105 user s manual u11302ej4v0um figure 5-4. format of display mode register 0 (1/2) r/w segs4 segs3 segs2 segs1 segs0 display segment (display mode 1) display output total (display mode 2) 000009 9 0000110 10 0001011 11 0001112 12 0010013 13 0010114 14 0011015 15 0011116 16 0100017 17 0100118 18 0101019 19 0101120 20 0110021 21 0110122 22 0111023 23 0111124 24 1000025 25 1000126 26 1001027 27 1001128 28 1010029 29 1010130 30 1011031 31 1011132 32 1100033 33 1100134 34 1101035 35 1101136 36 1110037 37 1110138 note 38 1111039 note 39 1111140 note 40 note when the sum of digits and segments is over 53, specification of the number of digits has priority. 710 65432 ksf segs1 segs0 dspm06 dspm05 segs4 segs3 segs2 symbol dspm0 f f a 0 h 0 0 h r/w address after reset r/w
chapter 5 clock generator 106 user s manual u11302ej4v0um figure 5-4. format of display mode register 0 (2/2) r/w dspm05 display mode setting 0 display mode 1 (segment/character type) 1 display mode 2 (type in which a segment spans two or more grids) r/w dspm06 mode of noise eliminator for subsystem clock note 2 0 2.5 mhz < f x 5.0 mhz 1 1.25 mhz f x 2.5 mhz note 3 r ksf timing status 0 display timing 1 key scan timing notes 1. bit 7 (ksf) is a read-only bit. 2. set this bit according to the main system clock oscillation frequency (f x ) selected. the noise eliminator operates during vfd display. 3. when f x is used between 1.25 mhz and 2.5 mhz, set bit 6 (dspm06) to 1 prior to vfd display. caution when the main system clock frequency selected is below 1.25 mhz and the vfd controller/ driver is enabled, make sure to use the main system clock for watch timer counting by setting tcl24 to 0. 710 65432 ksf segs1 segs0 dspm06 dspm05 segs4 segs3 segs2 symbol dspm0 f f a 0 h 0 0 h r/w note 1 address after reset r/w
chapter 5 clock generator 107 user s manual u11302ej4v0um (3) display mode register 1 (dspm1) register to set display operation/stop. dspm1 is set with an 8-bit memory manipulation instruction. reset input sets dspm1 to 00h. remark in addition to setting display operation/stop, dspm1 can also set the display digits/number of display patterns, cut width of the vfd output, and display cycle.
chapter 5 clock generator 108 user s manual u11302ej4v0um figure 5-5. format of display mode register 1 dims0 display mode cycle setting 0 1024/f x is 1 display cycle (1 display cycle = 204.8 s: @ 5.0 mhz operation) 1 2048/f x is 1 display cycle (1 display cycle = 409.6 s: @ 5.0 mhz operation) dims3 dims2 dims1 vfd output signal cut width 0 0 0 1/16 0 0 1 2/16 0 1 0 4/16 0 1 1 6/16 1 0 0 8/16 1 0 1 10/16 1 1 0 12/16 1 1 1 14/16 digs3 digs2 digs1 digs0 display digits (display mode 1) dspm05 = 0 display patterns (display mode 2) dspm05 = 1 0000 display stopped (static display) note display stopped (static display) note 00012 digits 2 patterns 00103 digits 3 patterns 00114 digits 4 patterns 01005 digits 5 patterns 01016 digits 6 patterns 01107 digits 7 patterns 01118 digits 8 patterns 10009 digits 9 patterns 100110 digits 10 patterns 101011 digits 11 patterns 101112 digits 12 patterns 110013 digits 13 patterns 110114 digits 14 patterns 111015 digits 15 patterns 111116 digits 16 patterns note when setting display stopped, static display can be set by operating the port output latch. remarks 1. f x : main system clock oscillation frequency 2. dspm05: bit 5 of display mode register 0 (dspm0) 710 65432 digs3 dims1 dims0 digs2 digs1 digs0 dims3 dims2 symbol dspm1 f f a 1 h 0 0 h r/w address after reset r/w
chapter 5 clock generator 109 user s manual u11302ej4v0um 5.4 system clock oscillator 5.4.1 main system clock oscillator the main system clock oscillator oscillates with a crystal resonator or a ceramic resonator (standard: 5.0 mhz) connected to the x1 and x2 pins. external clocks can be input to the main system clock oscillator. in this case, input a clock signal to the x1 pin and its inverted signal to the x2 pin. figure 5-6 shows an external circuit of the main system clock oscillator. figure 5-6. external circuit of main system clock oscillator (a) crystal or ceramic oscillation (b) external clock caution do not execute the stop instruction or set bit 7 (mcc) of the processor clock control register (pcc) to 1 while an external clock is being input. this is because the operation of the main system clock is stopped and the x2 pin is pulled up to v dd if the stop instruction is executed or mcc is set to 1. crystal or ceramic resonator x2 x1 ic external clock x2 x1
chapter 5 clock generator 110 user s manual u11302ej4v0um 5.4.2 subsystem clock oscillator the subsystem clock oscillator oscillates with a crystal resonator (standard: 32.768 khz) connected to the xt1 and xt2 pins. external clocks can be input to the subsystem clock oscillator. in this case, input a clock signal to the xt1 pin and its inverted signal to the xt2 pin. figure 5-7 shows an external circuit of the subsystem clock oscillator. figure 5-7. external circuit of subsystem clock oscillator (a) crystal oscillation (b) external clock cautions 1. when using the main system or subsystem clock oscillator, wire as follows in the area enclosed by the broken lines in figures 5-6 and 5-7 to avoid an adverse effect from wiring capacitance. keep the wiring length as short as possible. do not cross the wiring with the other signal lines. do not route the wiring near a signal line through which a high fluctuating current flows. always make the ground point of the oscillator capacitor the same potential as v ss . do not ground the capacitor to a ground pattern through which a high current flows. do not fetch signals from the oscillator. when using the subsystem clock oscillator, pay special attention because the subsystem clock oscillator has low amplification to minimize power consumption. figure 5-8 shows examples of incorrect resonator connection. xt1 ic xt2 32.768 khz external clock xt2 xt1
chapter 5 clock generator 111 user s manual u11302ej4v0um figure 5-8. examples of incorrect resonator connection (1/2) (a) too long wiring of connected circuit (b) crossed signal lines (c) high alternating current close to (d) current flowing through ground line signal lines of oscillator (potentials at points a, b, and c change) remark when using a subsystem clock, replace x1 and x2 with xt1 and xt2, respectively. further, insert resistors in series on the side of xt2. x2 x1 ic portn (n = 0 to 3, 7 to 12) x2 x1 ic ic x1 x2 high current x2 x1 ic c b a pmn v dd high current
chapter 5 clock generator 112 user s manual u11302ej4v0um figure 5-8. examples of incorrect resonator connection (2/2) (e) signal fetched remark when using a subsystem clock, replace x1 and x2 with xt1 and xt2, respectively. further, insert resistors in series on the side of xt2. cautions 2. if xt2 and x1 are wired in parallel, malfunction may occur due to the crosstalk noise between xt2 and x1. to prevent this, connect the ic pin directly to the v ss pin located between the xt2 and x1 pins, and do not wire xt2 and x1 in parallel. ic x1 x2
chapter 5 clock generator 113 user s manual u11302ej4v0um 5.4.3 divider the divider divides the main system clock oscillator output (f x ) and generates various clocks. 5.4.4 when subsystem clock is not used if it is not necessary to use the subsystem clock for low power consumption operations and clock operations, connect the xt1 and xt2 pins as follows. xt1: connect to v dd or v ss xt2: leave open in this state, however, some current may leak via the internal feedback resistor of the subsystem clock oscillator when the main system clock stops. to prevent this from happening, set bit 6 (frc) of the processor clock control register (pcc) to disable use of the above internal feedback resistor. in this case also, connect the xt1 and xt2 pins as described above.
chapter 5 clock generator 114 user s manual u11302ej4v0um 5.5 clock generator operations the clock generator generates the following various types of clocks and controls the cpu operating mode including the standby mode. main system clock f x subsystem clock f xt cpu clock f cpu clock to peripheral hardware the function and operation of the clock generator are determined by the processor clock control register (pcc) as follows. (a) upon generation of the reset signal, the lowest speed mode of the main system clock (6.4 s when operated at 5.0 mhz) is selected (pcc = 04h). main system clock oscillation stops while a low level is applied to the reset pin. (b) with the main system clock selected, one of the five stages of minimum instruction execution time (0.4 s, 0.8 s, 1.6 s, 3.2 s, and 6.4 s: when operated at 5.0 mhz) can be selected by setting pcc. (c) with the main system clock selected, two standby modes, the stop and halt modes, are available. when the system is not using the subsystem clock, the power consumption in the stop mode can be decreased if the internal feedback resistor is not used by setting bit 6 (frc) of pcc. (d) pcc can be used to select the subsystem clock and to operate the system with low power consumption (122 s when operated at 32.768 khz). (e) with the subsystem clock selected, main system clock oscillation can be stopped using pcc. the halt mode can be used, but the stop mode cannot be used (subsystem clock oscillation cannot be stopped). (f) the main system clock is divided and supplied to the peripheral hardware. the subsystem clock is supplied to the watch timer and clock output functions only. thus, the watch function and the clock output function can also be continued in the standby state. however, since all other peripheral hardware operate with the main system clock, the peripheral hardware also stop if the main system clock is stopped (except during operation using an externally input clock).
chapter 5 clock generator 115 user s manual u11302ej4v0um 5.5.1 main system clock operations during operation with the main system clock (when bit 5 (cls) of the processor clock control register (pcc) is set to 0), the following operations are carried out via pcc settings. (a) because the operation guaranteed instruction execution speed depends on the power supply voltage, the minimum instruction execution time can be changed by setting bits 0 to 2 (pcc0 to pcc2) of pcc. (b) if bit 7 (mcc) of pcc is set to 1 during operation with the main system clock, the main system clock oscillation does not stop. when bit 4 (css) of pcc is set to 1 and the operation is switched to subsystem clock operation (cls = 1) after that, the main system clock oscillation stops (see figure 5-9 ). figure 5-9. main system clock stop function (1/2) (a) operation when mcc is set after setting css during main system clock operation (b) operation when mcc is set during main system clock operation mcc css cls main system clock oscillation subsystem clock oscillation cpu clock mcc css cls main system clock oscillation subsystem clock oscillation cpu clock l l oscillation does not stop.
chapter 5 clock generator 116 user s manual u11302ej4v0um figure 5-9. main system clock stop function (2/2) (c) operation when css is set after setting mcc during main system clock operation 5.5.2 subsystem clock operations during operation with the subsystem clock (when bit 5 (cls) of the processor clock control register (pcc) is set to 1), the following operations are carried out. (a) the minimum instruction execution time remains constant (122 s during operation at 32.768 khz) irrespective of the setting of bits 0 to 2 (pcc0 to pcc2) of pcc. (b) watchdog timer counting stops. caution do not execute the stop instruction while the subsystem clock is operating. mcc css cls main system clock oscillation subsystem clock oscillation cpu clock
chapter 5 clock generator 117 user s manual u11302ej4v0um 5.6 changing system clock and cpu clock settings 5.6.1 time required for switchover between system clock and cpu clock the system clock and cpu clock can be switched over by using bits 0 to 2 (pcc0 to pcc2) and bit 4 (css) of the processor clock control register (pcc). the actual switchover operation is not performed directly after writing to the pcc; operation continues on the pre-switchover clock for several instructions (see table 5-3 ). it can be judged by bit 5 (cls) of pcc whether the system is operating on the main system clock or the subsystem clock. table 5-3. maximum time required for cpu clock switchover caution selection of the cpu clock cycle division ratio (pcc0 to pcc2) and switchover from the main system clock to the subsystem clock (changing css from 0 to 1) should not be specified simultaneously. simultaneous setting is possible, however, for selection of the cpu clock cycle division ratio (pcc0 to pcc2) and switchover from the subsystem clock to the main system clock (changing css from 1 to 0). remarks 1. one instruction is the minimum instruction execution time with the pre-switchover cpu clock. 2. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 css pcc2 pcc1 pcc0 0000000 10010001101001 xxx 000 001 010 011 100 xxx 1 0 set values after switchover 16 instructions f x /2f xt instructions (64 instructions) 4 instructions 2 instructions 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 2 instructions 2 instructions 2 instructions 4 instructions 4 instructions 4 instructions 16 instructions 16 instructions 16 instructions 8 instructions 8 instructions 8 instructions 8 instructions f x /4f xt instructions (32 instructions) f x /8f xt instructions (16 instructions) f x /16f xt instructions (8 instructions) f x /32f xt instructions (4 instructions) set values before switchover
chapter 5 clock generator 118 user s manual u11302ej4v0um 5.6.2 system clock and cpu clock switching procedure this section describes the procedure for switching between the system clock and cpu clock. figure 5-10. system clock and cpu clock switching [1] the cpu is reset by setting the reset signal to low level after power-on. after that, when reset is released by setting the reset signal to high level, the main system clock starts oscillating. at this time, the oscillation stabilization time (2 17 /f x ) is secured automatically. after that, the cpu starts executing the instruction at the minimum speed of the main system clock (6.4 s when operated at 5.0 mhz). [2] after the lapse of a sufficient time for the v dd voltage to increase to enable operation at maximum speeds, the processor clock control register (pcc) is rewritten and the maximum-speed operation is carried out. [3] upon detection of a decrease of the v dd voltage due to an interrupt request signal, the main system clock is switched to the subsystem clock (which must be in an oscillation stable state). [4] upon detection of v dd voltage reset due to an interrupt request signal, bit 7 (mcc) of pcc is set to 0 and oscillation of the main system clock is started. after the lapse of time required for stabilization of oscillation, pcc is rewritten and the maximum-speed operation is resumed. caution when the main system clock is stopped and the subsystem clock is operating, switch to the main system clock after securing the oscillation stabilization time by program. wait (26.2 ms: @5.0 mhz) internal reset operation system clock cpu clock interrupt request signal minimum speed operation maximum speed operation f x f x f xt subsystem clock operation f x high-speed operation reset v dd
119 user? manual u11302ej4v0um chapter 6 16-bit timer/event counter 6.1 outline of timers incorporated in pd780208 subseries this chapter explains the 16-bit timer/event counter. first of all, the timers incorporated in the pd780208 subseries and other related parts are outlined below. (1) 16-bit timer/event counter (tm0) the tm0 can be used for an interval timer, pwm output, pulse width measurement (infrared remote control receive function), external event counter or square-wave output of any frequency. (2) 8-bit timer/event counters (tm1 and tm2) tm1 and tm2 can be used for an interval timer and an external event counter and to output square waves with any selected frequency. two 8-bit timer/event counters can be used as one 16-bit timer/event counter (refer to chapter 7 8-bit timer/event counter ). (3) watch timer (tm3) this timer can set a flag every 0.5 seconds and simultaneously generate interrupt requests at preset time intervals (refer to chapter 8 watch timer ). (4) watchdog timer (wdtm) wdtm can perform a watchdog timer function or generate non-maskable interrupt requests, maskable interrupt requests and reset at preset time intervals (refer to chapter 9 watchdog timer ). (5) clock output controller this circuit supplies other devices with the divided main system clock and the subsystem clock (refer to chapter 10 clock output controller ). (6) buzzer output controller this circuit outputs the buzzer frequency obtained by dividing the main system clock (refer to chapter 11 buzzer output controller ).
chapter 6 16-bit timer/event counter 120 user? manual u11302ej4v0um table 6-1. timer/event counter operations 16-bit timer/ 8-bit timer/ watch watchdog event counter event counter timer timer operation interval timer 1 channel 2 channels 1 channel note 1 1 channel note 2 mode external event counter ? function timer output ? pwm output pulse width measurement square-wave output ? interrupt request ? test input notes 1. the watch timer can perform both watch timer and interval timer functions at the same time. 2. the watchdog timer can perform either the watchdog timer function or the interval timer function. 6.2 16-bit timer/event counter functions the 16-bit timer/event counter (tm0) has the following functions. interval timer pwm output pulse width measurement external event counter square-wave output
chapter 6 16-bit timer/event counter 121 user? manual u11302ej4v0um (1) interval timer tm0 generates interrupt requests at the preset time interval. table 6-2. 16-bit timer/event counter interval time minimum interval time maximum interval time resolution 2 x ti0 input cycle 2 16 x ti0 input cycle ti0 input edge cycle 2 x 1/f x (400 ns) 2 16 x 1/f x (13.1 ms) 1/f x (200 ns) 2 2 x 1/f x (800 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 2 3 x 1/f x (1.6 s) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 2 4 x 1/f x (3.2 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. (2) pwm output tm0 can generate 14-bit resolution pwm output. (3) pulse width measurement tm0 can measure the pulse width of an externally input signal. (4) external event counter tm0 can measure the number of pulses of an externally input signal. (5) square-wave output tm0 can output a square wave with any selected frequency. table 6-3. 16-bit timer/event counter square-wave output ranges minimum pulse width maximum pulse width resolution 2 x ti0 input cycle 2 16 x ti0 input cycle ti0 input edge cycle 2 x 1/f x (400 ns) 2 16 x 1/f x (13.1 ms) 1/f x (200 ns) 2 2 x 1/f x (800 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 2 3 x 1/f x (1.6 s) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 2 4 x 1/f x (3.2 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 6 16-bit timer/event counter 122 user? manual u11302ej4v0um 6.3 16-bit timer/event counter configuration the 16-bit timer/event counter consists of the following hardware. table 6-4. 16-bit timer/event counter configuration item configuration timer register 16 bits x 1 (tm0) registers 16-bit compare register: 1 (cr00) 16-bit capture register: 1 (cr01) timer outputs 1 (to0) control registers timer clock select register 0 (tcl0) 16-bit timer mode control register (tmc0) 16-bit timer output control register (toc0) port mode register 3 (pm3) external interrupt mode register (intm0) sampling clock select register (scs) note note refer to figure 16-1 basic configuration of interrupt function .
chapter 6 16-bit timer/event counter 123 user? manual u11302ej4v0um figure 6-1. block diagram of 16-bit timer/event counter (timer mode) notes 1. edge detector 2. for the configuration of the 16-bit timer/event counter output controller, refer to figure 6-3 . f x /2 3 f x /2 2 f x /2 internal bus 16-bit timer mode control register timer clock select register 0 tcl06 tcl05 tcl04 16-bit capture register (cr01) tmc03 ovf0 tmc02 tmc01 selector f x ti0/p00/intp0 note 1 intp0 16-bit timer register lower 8 bits (tm0l) 16-bit timer register higher 8 bits (tm0h) inttm0 16-bit compare register (cr00) 015 015 7 0 15 selector clear clear note 2 16-bit timer/event counter output controller 16-bit timer output control register lvs0 toe0 lvr0 toc01 3 2 3 internal bus match match ovf to0/p30
chapter 6 16-bit timer/event counter 124 user s manual u11302ej4v0um figure 6-2. block diagram of 16-bit timer/event counter (pwm mode) remark the circuitry enclosed by the dotted line is the output controller. f x /2 3 f x /2 2 f x /2 f x internal bus timer clock select register 0 tcl06 tcl05 tcl04 16-bit capture register (cr01) 16-bit timer register (tm0) pwm pulse generator 16-bit compare register (cr00) internal bus toc01 toe0 selector 3 p30 output latch port mode register 3 to0/p30 pm30 16-bit timer output control register selector
chapter 6 16-bit timer/event counter 125 user s manual u11302ej4v0um figure 6-3. block diagram of 16-bit timer/event counter output controller notes 1. bits 2 and 3 of the external interrupt mode register (intm0) 2. bit 0 of port mode register 3 (pm3) remark the circuitry enclosed by the dotted line is the output controller. to0/p30 p30 output latch pm30 note 2 toe0 selector tmc01 to tmc03 inv edge detector toc01 lvs0 s lvr0 r inttm0 pwm pulse generator 2 ti0/p00/intp0 q toc01 3 tmc01 to tmc03 3 es10, es11 note 1 active level control level f/f (lv0) selector
chapter 6 16-bit timer/event counter 126 user s manual u11302ej4v0um (1) 16-bit compare register (cr00) cr00 is a 16-bit register whose value is constantly compared with the 16-bit timer register (tm0) count value, and an interrupt request (inttm0) is generated if they match. it can also be used as the register that holds the interval time when tm0 is set to interval timer operation, and as the register that sets the pulse width when tm0 is set to pwm output operation. cr00 is set with a 16-bit memory manipulation instruction. values from 0001h to ffffh can be set. reset input makes cr00 undefined. cautions 1. the pwm data (14 bits) must be set in the higher 14 bits of cr00. the lower two bits must be set to 00. 2. cr00 should be set to a value other than 0000h. this means that when the timer is used as an event counter, a 1-pulse count operation is not possible. 3. when the value after cr00 is changed is smaller than that of the 16-bit timer register (tm0), tm0 continues to count and overflows, then resumes counting from 0. therefore, if the value after cr00 is changed is smaller than the value before cr00 is changed, the timer needs to be restarted after cr00 is changed. (2) 16-bit capture register (cr01) cr01 is a 16-bit register used to capture the contents of the 16-bit timer (tm0). the capture trigger is the intp0/ti0 pin valid edge input. the intp0 valid edge is set by the external interrupt mode register (intm0). cr01 is read with a 16-bit memory manipulation instruction. reset input makes cr01 undefined. caution if the valid edge for the ti0/p00 pin is input during a read from cr01, cr01 does not perform the capture operation and holds the previous data. in this case, however, the interrupt request flag (pif0) is set because a valid edge is detected. (3) 16-bit timer register (tm0) tm0 is a 16-bit register that counts the count pulse. tm0 is read with a 16-bit memory manipulation instruction. reset input sets tm0 to 0000h. caution as reading of the value of tm0 is performed via cr01, the previously set value of cr01 is lost.
chapter 6 16-bit timer/event counter 127 user s manual u11302ej4v0um 6.4 16-bit timer/event counter control registers the following six registers are used to control the 16-bit timer/event counter. timer clock select register 0 (tcl0) 16-bit timer mode control register (tmc0) 16-bit timer output control register (toc0) port mode register 3 (pm3) external interrupt mode register (intm0) sampling clock select register (scs) (1) timer clock select register 0 (tcl0) this register is used to set the count clock of the 16-bit timer register. tcl0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets tcl0 to 00h. remark tcl0 has the function of setting the pcl output clock in addition to that of setting the count clock of the 16-bit timer register.
chapter 6 16-bit timer/event counter 128 user s manual u11302ej4v0um figure 6-4. format of timer clock select register 0 cautions 1. the ti0/intp0 pin valid edge is specified by the external interrupt mode register (intm0), and the sampling clock frequency is selected by the sampling clock select register (scs). 2. when enabling pcl output, set tcl00 to tcl03, then set cloe to 1 with a 1-bit memory manipulation instruction. 3. to read the count value when ti0 has been specified as the tm0 count clock, the value should be read from tm0, not from the 16-bit capture register (cr01). 4. if tcl0 is to be rewritten with data other than identical data, the timer operation must be stopped first. remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency 3. ti0: 16-bit timer/event counter input pin 4. tm0: 16-bit timer register 5. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. 6. refer to chapter 10 clock output controller for pcl. tcl00 tcl0 <7>65432 symbol 10 tcl03 pcl output clock selection ff40h tcl01 tcl03 tcl02 tcl04 tcl05 tcl06 cloe address after reset r/w 00h r/w 0 f xt (32.768 khz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) setting prohibited tcl06 16-bit timer register count clock selection 0 ti0 (valid edge specifiable) 0 f x (5.0 mhz) 0 f x /2 (2.5 mhz) 0 f x /2 2 (1.25 mhz) 1 f x /2 3 (625 khz) setting prohibited cloe pcl output control 0 output disabled 1 output enabled tcl02 0 1 0 0 0 0 1 tcl01 0 1 0 0 1 1 0 other than above tcl00 0 1 0 1 0 1 0 tcl05 0 0 1 1 0 other than above tcl04 0 1 0 1 0
chapter 6 16-bit timer/event counter 129 user s manual u11302ej4v0um (2) 16-bit timer mode control register (tmc0) this register sets the 16-bit timer operating mode, the 16-bit timer register clear mode and output timing, and detects an overflow. tmc0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets tmc0 to 00h. caution the 16-bit timer register starts operating when tmc01 to tmc03 are set to a value other than 0, 0, 0 (operation stop mode). to stop the timer operation, set tmc01 to tcm03 to 0, 0, 0.
chapter 6 16-bit timer/event counter 130 user s manual u11302ej4v0um figure 6-5. format of 16-bit timer mode control register ovf0 16-bit timer register overflow detection 0 overflow not detected 1 overflow detected operating mode & clear to0 output timing interrupt request tmc03 tmc02 tmc01 mode selection selection generation operation stop no change not generated (tm0 cleared to 0) pwm mode pwm pulse output (free-running) free-running mode match between tm0 and 010 cr00 match between tm0 and cr00 or ti0 valid edge clear & start on ti0 valid match between tm0 and edge cr00 match between tm0 and cr00 or ti0 valid edge match between tm0 and 110 cr00 match between tm0 and cr00 or ti0 valid edge cautions 1. switch the clear mode and the to0 output timing after stopping the timer operation (by setting tmc01 to tmc03 to 0, 0, 0). 2. the valid edge of the ti0/intp0 pin is specified by the external interrupt mode register (intm0) and the sampling clock frequency is selected by the sampling clock select register (scs). 3. when using the pwm mode, set the pwm mode and then set data to cr00. remark to0: 16-bit timer/event counter output pin ti0: 16-bit timer/event counter input pin tm0: 16-bit timer register cr00: compare register 00 001 000 100 011 111 101 clear & start on match between tm0 and cr00 generated on match between tm0 and cr00 ovf0 tmc0 765432 symbol 1 <0> ff48h tmc01 tmc03 tmc02 0 0 0 0 address after reset r/w 00h r/w
chapter 6 16-bit timer/event counter 131 user s manual u11302ej4v0um (3) 16-bit timer output control register (toc0) this register controls the operation of the 16-bit timer/event counter output controller. it sets/resets the r-s type flip-flop (lv0), sets the active level in pwm mode, and enables/disables inversion in modes other than pwm mode and data output mode. toc0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets toc0 to 00h. figure 6-6. format of 16-bit timer output control register cautions 1. timer operation must be stopped before setting toc0. 2. if lvs0 and lvr0 are read after data is set, they will be 0. toe0 toc0 7654 <3> <2> symbol 1 <0> toe0 16-bit timer/event counter output control 0 1 output disabled (port mode) output enabled ff4eh toc01 lvs0 toc01 lvs0 16-bit timer/event counter timer output f/f status setting 0 0 no change timer output f/f reset (0) 1 1 lvr0 0 1 0 1 timer output f/f set (1) setting prohibited lvr0 0 in pwm mode 0 1 active level selection timer output f/f control active high active low in other modes inversion operation disabled inversion operation enabled address after reset r/w 00h r/w 000
chapter 6 16-bit timer/event counter 132 user s manual u11302ej4v0um (4) port mode register 3 (pm3) this register sets port 3 input/output in 1-bit units. when using the p30/to0 pin for timer output, set pm30 and the output latch of p30 to 0. pm3 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pm3 to ffh. figure 6-7. format of port mode register 3 pm3 65432 symbol 10 pm37 pm3n p3n pin i/o mode selection (n = 0 to 7) 0 1 output mode (output buffer on) input mode (output buffer off) ff23h pm36 pm35 pm34 pm33 pm32 pm31 pm30 7 address after reset r/w ffh r/w
chapter 6 16-bit timer/event counter 133 user s manual u11302ej4v0um (5) external interrupt mode register (intm0) this register is used to set the intp0 to intp2 and ti0 valid edges. intm0 is set with an 8-bit memory manipulation instruction. reset input sets intm0 to 00h. remarks 1. the intp0 pin is also used as ti0/p00. 2. the valid edge of intp3 is fixed to the falling edge. figure 6-8. format of external interrupt mode register 0 intm0 765432 symbol 10 es10 es11 intp0/ti0 valid edge selection 0 0 falling edge rising edge ffech 0 es11 es20 es21 es30 es31 1 1 es10 0 1 0 1 setting prohibited both falling and rising edges es21 intp1 valid edge selection 0 0 falling edge rising edge 1 1 es20 0 1 0 1 setting prohibited both falling and rising edges es31 intp2 valid edge selection 0 0 falling edge rising edge 1 1 es30 0 1 0 1 setting prohibited both falling and rising edges address after reset r/w 00h r/w caution when using the intp0/ti0/p00 pin as a timer input pin (ti0), stop the operation of the 16-bit timer by clearing bits 1 to 3 (tmc01 to tmc03) of the 16-bit timer mode control register (tmc0) to 0, 0, 0, before setting the valid edge of ti0. when using the intp0/ti0/p00 pin as an external interrupt input pin (intp0), the valid edge of intp0 may be set while the 16-bit timer is operating.
chapter 6 16-bit timer/event counter 134 user s manual u11302ej4v0um (6) sampling clock select register (scs) this register sets the clock to be used for sampling the valid edge input to intp0. when remote controlled reception is carried out using intp0, digital noise is eliminated using the sampling clock. scs is set with an 8-bit memory manipulation instruction. reset input sets scs to 00h. figure 6-9. format of sampling clock select register caution f x /2 n+1 is the clock supplied to the cpu, and f x /2 6 and f x /2 7 are clocks supplied to peripheral hardware. f x /2 n+1 is stopped in halt mode. remarks 1. n: value set in bits 0 to 2 (pcc0 to pcc2) of the processor clock control register (pcc) (n = 0 to 4) 2. f x : main system clock oscillation frequency 3. figures in parentheses apply to operation with f x = 5.0 mhz. scs0 scs 765432 symbol 10 0 scs1 intp0 sampling clock selection 0 0 f x /2 n+1 setting prohibited ff47h 0 0 0 0 0 1 1 0 1 0 1 f x /2 6 (78.1 khz) f x /2 7 (39.1 khz) scs1 scs0 address after reset r/w 00h r/w
chapter 6 16-bit timer/event counter 135 user s manual u11302ej4v0um 6.5 16-bit timer/event counter operations 6.5.1 interval timer operations by setting bits 2 and 3 (tmc02 and tmc03) of the 16-bit timer mode control register (tmc0) to 1, 1, the 16-bit timer/event counter operates as an interval timer. interrupt requests are generated repeatedly using the count value set in the 16-bit compare register (cr00) beforehand as the interval. when the count value of the 16-bit timer register (tm0) matches the value set to cr00, counting continues with the tm0 value cleared to 0 and the interrupt request signal (inttm0) is generated. cr00 should be set to a value other than 0000h. the count clock of the 16-bit timer/event counter can be selected using bits 4 to 6 (tcl04 to tcl06) of timer clock select register 0 (tcl0). for the operation when the value of the compare register is changed during timer count operation, refer to 6.6 16- bit timer/event counter operating precautions (3) . figure 6-10. interval timer configuration diagram 16-bit compare register (cr00) 16-bit timer register (tm0) f x f x /2 f x /2 2 f x /2 3 ti0/p00/intp0 ovf0 inttm0 clear circuit selector
chapter 6 16-bit timer/event counter 136 user s manual u11302ej4v0um figure 6-11. interval timer operation timing remark interval time = (n + 1) x t: n = 0001h to ffffh table 6-5. 16-bit timer/event counter interval time tcl06 tcl05 tcl04 minimum interval time maximum interval time resolution 0 0 0 2 x ti0 input cycle 2 16 x ti0 input cycle ti0 input edge cycle 0 0 1 2 x 1/f x (400 ns) 2 16 x 1/f x (13.1 ms) 1/f x (200 ns) 01 0 2 2 x 1/f x (800 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 01 1 2 3 x 1/f x (1.6 s) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 10 0 2 4 x 1/f x (3.2 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) other than above setting prohibited remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. t 0000 tm0 count value count clock cr00 inttm0 to0 0001 n 0000 0001 n 0000 0001 n count start clear clear interrupt request acknowledgment nn nn interval time interval time interval time interrupt request acknowledgment
chapter 6 16-bit timer/event counter 137 user s manual u11302ej4v0um 6.5.2 pwm output operations by setting bits 1 to 3 (tmc01 to tmc03) of the 16-bit timer mode control register (tmc0) to 1, 0, 0, the 16-bit timer/ event counter operates as pwm output. pulses with a duty determined by the value set in the 16-bit compare register (cr00) beforehand are output from the to0/p30 pin. set the active level width of the pwm pulse to the higher 14 bits of cr00. select the active level using bit 1 (toc01) of the 16-bit timer output control register (toc0). this pwm pulse has a 14-bit resolution. the pulse can be converted to an analog voltage by integrating it with an external low-pass filter (lpf). the pwm pulse has a combination of the basic cycle determined by 2 8 / and the sub-cycle determined by 2 14 / so that the time constant of the external lpf can be shortened. count clock can be selected using bits 4 to 6 (tcl04 to tcl06) of timer clock select register 0 (tcl0). pwm output enable/disable can be selected using bit 0 (toe0) of toc0. cautions 1. cr00 should be set after selecting the pwm operation mode. 2. be sure to write 0 to bits 0 and 1 of cr00. 3. do not select the pwm operation mode when an external clock is input from the ti0/p00 pin. by integrating 14-bit resolution pwm pulses with an external low-pass filter, they can be converted to an analog voltage and used for electronic tuning and d/a converter applications, etc. the analog output voltage (v an ) used for d/a conversion with the configuration shown in figure 6-12 is as follows. compare register (cr00) value v an = v ref x 2 16 v ref : external switching circuit reference voltage figure 6-12. example of d/a converter configuration with pwm output v ref pd780205 pwm signal to0/p30 switching circuit low-pass filter analog output (v an )
chapter 6 16-bit timer/event counter 138 user s manual u11302ej4v0um figure 6-13 shows an example in which pwm output is converted to an analog voltage and used in a voltage synthesizer type tv tuner. figure 6-13. tv tuner application circuit example 6.5.3 pulse width measurement operations it is possible to measure the pulse width of the signals input to the ti0/p00 pin using the 16-bit timer register (tm0). there are two measurement methods: measuring with the 16-bit timer register (tm0) used in free-running mode, and measuring by restarting the timer in synchronization with the valid edge of the signal input to the ti0/p00 pin. (1) pulse width measurement in free-running mode when the 16-bit timer register (tm0) is operated in free-running mode, if the edge specified by the external interrupt mode register (intm0) is input, the value of tm0 is taken into the capture register (cr01) and an external interrupt request signal (intp0) is set. any of three edge specifications can be selected rising, falling, or both edges by using bits 2 and 3 (es10 and es11) of intm0. for valid edge detection, sampling is performed at the interval selected by the sampling clock select register (scs), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise with a short pulse width. 0.22 f pd780205 +110 v 22 k ? 47 k ? 47 k ? 47 k ? 100 pf to0/p30 v ss 8.2 k ? 8.2 k ? 0.22 f 0.22 f gnd electronic tuner
chapter 6 16-bit timer/event counter 139 user s manual u11302ej4v0um figure 6-14. configuration diagram for pulse width measurement in free-running mode figure 6-15. timing of pulse width measurement operation in free-running mode (with both edges specified) 16-bit timer register (tm0) f x f x /2 f x /2 2 f x /2 3 ovf0 selector ti0/p00/intp0 16-bit capture register (cr01) intp0 internal bus t count clock tm0 count value ti0 pin input cr01 captured value intp0 ovf0 0000 0001 d0 d1 ffff 0000 d2 d3 d0 d1 d2 d3 (d1 _ d0) x t (10000h _ d1 + d2) x t (d3 _ d2) x t
chapter 6 16-bit timer/event counter 140 user s manual u11302ej4v0um (2) pulse width measurement by means of restart when input of a valid edge to the ti0/p00 pin is detected, the count value of the 16-bit timer register (tm0) is taken into the 16-bit capture register (cr01), and then the pulse width of the signal input to the ti0/p00 pin is measured by clearing tm0 and restarting the count. the edge specification can be selected from three types rising, falling, and both edges by using bits 2 and 3 (es10 and es11) of the external interrupt mode register (intm0). for valid edge detection, sampling is performed at the interval selected by the sampling clock select register (scs), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise with a short pulse width. figure 6-16. timing of pulse width measurement operation by means of restart (with both edges specified) 6.5.4 external event counter operation the external event counter counts the number of external clock pulses input to the ti0/p00 pin using the 16-bit timer register (tm0). tm0 is incremented each time the valid edge specified by the external interrupt mode register (intm0) is input. when the tm0 count value matches the 16-bit compare register (cr00) value, tm0 is cleared to 0 and the interrupt request signal (inttm0) is generated. set cr00 to a value other than 0000h (a 1-pulse count operation cannot be performed). the rising edge, falling edge or both edges can be selected using bits 2 and 3 (es10 and es11) of intm0. for valid edge detection, sampling is performed at the interval selected by the sampling clock select register (scs), and a counter operation is only performed when a valid level is detected twice, thus eliminating noise with a short pulse width. t 0000 tm0 count value count clock cr01 captured value intp0 0001 d0 0000 0001 d1 0000 0001 d0 (d0 + 1) x t (d1 + 1) x t ti0 pin input d1
chapter 6 16-bit timer/event counter 141 user s manual u11302ej4v0um figure 6-17. external event counter configuration diagram figure 6-18. external event counter operation timing (with rising edge specified) ti0 pin input tm0 count value cr00 inttm0 0000 0001 0002 0003 0004 0005 n _ 1 n n 0000 0001 0002 0003 16-bit compare register (cr00) 16-bit timer register (tm0) ovf0 inttm0 intp0 internal bus 16-bit capture register (cr01) clear ti0 valid edge
chapter 6 16-bit timer/event counter 142 user s manual u11302ej4v0um 6.5.5 square-wave output operation the 16-bit timer/event counter outputs a square-wave of any frequency with the value preset to the 16-bit compare register (cr00) as the interval. the to0/p30 pin output status is reversed at intervals of the count value preset to cr00 by setting bit 0 (toe0) and bit 1 (toc01) of the 16-bit timer output control register (toc0) to 1. this enables a square wave with any selected frequency to be output. table 6-6. 16-bit timer/event counter square-wave output ranges tcl06 tcl05 tcl04 minimum pulse width maximum pulse width resolution 0 0 0 2 x ti0 input cycle 2 16 x ti0 input cycle ti0 input edge cycle 0 0 1 2 x 1/f x (400 ns) 2 16 x 1/f x (13.1 ms) 1/f x (200 ns) 01 0 2 2 x 1/f x (800 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 01 1 2 3 x 1/f x (1.6 s) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 10 0 2 4 x 1/f x (3.2 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) remarks 1. f x : main system clock oscillation frequency 2. tcl04 to tcl06: bits 4 to 6 of timer clock select register 0 (tcl0) 3. figures in parentheses apply to operation with f x = 5.0 mhz. figure 6-19. square-wave output operation timing note initial value of to0 output can be set by bits 2 and 3 (lvr0 and lvs0) of the 16-bit timer output control register (toc0). 0000 tm0 count value count clock 0001 n _ 1 n n _ 1 n 0000 to0 note 0002 0000 0001 0002 cr00 count start nn
chapter 6 16-bit timer/event counter 143 user s manual u11302ej4v0um 6.6 16-bit timer/event counter operating precautions (1) timer start errors an error of up to one clock may occur in the time required for a match signal to be generated after timer start. this is because the 16-bit timer register (tm0) is started asynchronously to the count pulse. figure 6-20. 16-bit timer register start timing (2) 16-bit compare register setting set the 16-bit compare register (cr00) to a value other than 0000h. thus, when using the 16-bit compare register as an event counter, a one-pulse count operation cannot be carried out. (3) operation after compare register change during timer count operation if the value after the 16-bit compare register (cr00) is changed is smaller than that of the 16-bit timer register (tm0), tm0 continues counting, overflows and then restarts counting from 0. thus, if the value after cr00 change (m) is smaller than that before change (n), it is necessary to restart the timer after changing cr00. figure 6-21. timing after compare register change during timer count operation remark n > x > m count pulse tm0 count value 0000h timer start 0001h 0002h 0003h 0004h count pulse cr00 captured value n m tm0 count value x _ 1 x ffffh 0000h 0001h 0002h
chapter 6 16-bit timer/event counter 144 user s manual u11302ej4v0um (4) capture register data retention timing if the valid edge of the ti0/p00 pin is input during 16-bit capture register (cr01) read, cr01 holds the data without carrying out the capture operation. however, the interrupt request signal (inttm0) is generated upon detection of the valid edge. figure 6-22. capture register data retention timing (5) valid edge setting when using the intp0/ti0/p00 pin as a timer input pin (ti0), stop the operation of the 16-bit timer by clearing bits 1 to 3 (tmc01 to tmc03) of the 16-bit timer mode control register (tmc0) to 0, 0, 0, before setting the valid edge of ti0. when using the intp0/ti0/p00 pin as an external interrupt input pin (intp0), the valid edge of intp0 may be set while the 16-bit timer is operating. count pulse cr01 captured value x n + 1 tm0 count value n n + 1 n + 2 m m + 1 m + 2 edge input inttm0 capture read signal capture operation ignored
145 user? manual u11302ej4v0um chapter 7 8-bit timer/event counter 7.1 8-bit timer/event counter functions the following two modes are available for the 8-bit timer/event counter incorporated in the pd780208 subseries. 8-bit timer/event counter mode: two-channel 8-bit timer/event counter with each channel used separately 16-bit timer/event counter mode: two-channel 8-bit timer/event counter used as 16-bit timer/event counter 7.1.1 8-bit timer/event counter mode 8-bit timer/event counters 1 and 2 (tm1 and tm2) have the following functions. interval timer external event counter square-wave output
chapter 7 8-bit timer/event counter 146 user? manual u11302ej4v0um (1) 8-bit interval timer interrupt requests are generated at the preset time intervals. table 7-1. 8-bit timer/event counter interval time minimum interval time maximum interval time resolution 2 x 1/f x (400 ns) 2 9 x 1/f x (102.4 s) 2 x 1/f x (400 ns) 2 2 x 1/f x (800 ns) 2 10 x 1/f x (204.8 s) 2 2 x 1/f x (800 ns) 2 3 x 1/f x (1.6 s) 2 11 x 1/f x (409.6 s) 2 3 x 1/f x (1.6 s) 2 4 x 1/f x (3.2 s) 2 12 x 1/f x (819.2 s) 2 4 x 1/f x (3.2 s) 2 5 x 1/f x (6.4 s) 2 13 x 1/f x (1.64 ms) 2 5 x 1/f x (6.4 s) 2 6 x 1/f x (12.8 s) 2 14 x 1/f x (3.28 ms) 2 6 x 1/f x (12.8 s) 2 7 x 1/f x (25.6 s) 2 15 x 1/f x (6.55 ms) 2 7 x 1/f x (25.6 s) 2 8 x 1/f x (51.2 s) 2 16 x 1/f x (13.1 ms) 2 8 x 1/f x (51.2 s) 2 9 x 1/f x (102.4 s) 2 17 x 1/f x (26.2 ms) 2 9 x 1/f x (102.4 s) 2 10 x 1/f x (204.8 s) 2 18 x 1/f x (52.4 ms) 2 10 x 1/f x (204.8 s) 2 12 x 1/f x (819.2 s) 2 20 x 1/f x (209.7 ms) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 147 user? manual u11302ej4v0um (2) external event counter the number of pulses of an externally input signal can be measured. (3) square-wave output a square wave with any selected frequency can be output. table 7-2. 8-bit timer/event counter square-wave output ranges minimum pulse width maximum pulse width resolution 2 x 1/f x (400 ns) 2 9 x 1/f x (102.4 s) 2 x 1/f x (400 ns) 2 2 x 1/f x (800 ns) 2 10 x 1/f x (204.8 s) 2 2 x 1/f x (800 ns) 2 3 x 1/f x (1.6 s) 2 11 x 1/f x (409.6 s) 2 3 x 1/f x (1.6 s) 2 4 x 1/f x (3.2 s) 2 12 x 1/f x (819.2 s) 2 4 x 1/f x (3.2 s) 2 5 x 1/f x (6.4 s) 2 13 x 1/f x (1.64 ms) 2 5 x 1/f x (6.4 s) 2 6 x 1/f x (12.8 s) 2 14 x 1/f x (3.28 ms) 2 6 x 1/f x (12.8 s) 2 7 x 1/f x (25.6 s) 2 15 x 1/f x (6.55 ms) 2 7 x 1/f x (25.6 s) 2 8 x 1/f x (51.2 s) 2 16 x 1/f x (13.1 ms) 2 8 x 1/f x (51.2 s) 2 9 x 1/f x (102.4 s) 2 17 x 1/f x (26.2 ms) 2 9 x 1/f x (102.4 s) 2 10 x 1/f x (204.8 s) 2 18 x 1/f x (52.4 ms) 2 10 x 1/f x (204.8 s) 2 12 x 1/f x (819.2 s) 2 20 x 1/f x (209.7 ms) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 148 user? manual u11302ej4v0um 7.1.2 16-bit timer/event counter mode (1) 16-bit interval timer interrupt requests can be generated at the preset time intervals. table 7-3. interval time when 8-bit timer/event counter is used as 16-bit timer/event counter minimum interval time maximum interval time resolution 2 x 1/f x (400 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 2 2 x 1/f x (800 ns) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 2 3 x 1/f x (1.6 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) 2 4 x 1/f x (3.2 s) 2 20 x 1/f x (209.7 ms) 2 4 x 1/f x (3.2 s) 2 5 x 1/f x (6.4 s) 2 21 x 1/f x (419.4 ms) 2 5 x 1/f x (6.4 s) 2 6 x 1/f x (12.8 s) 2 22 x 1/f x (838.9 ms) 2 6 x 1/f x (12.8 s) 2 7 x 1/f x (25.6 s) 2 23 x 1/f x (1.7 s) 2 7 x 1/f x (25.6 s) 2 8 x 1/f x (51.2 s) 2 24 x 1/f x (3.4 s) 2 8 x 1/f x (51.2 s) 2 9 x 1/f x (102.4 s) 2 25 x 1/f x (6.7 s) 2 9 x 1/f x (102.4 s) 2 10 x 1/f x (204.8 s) 2 26 x 1/f x (13.4 s) 2 10 x 1/f x (204.8 s) 2 12 x 1/f x (819.2 s) 2 28 x 1/f x (53.7 s) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 149 user? manual u11302ej4v0um (2) external event counter the number of pulses of an externally input signal can be measured. (3) square-wave output a square wave with any selected frequency can be output. table 7-4. square-wave output ranges when 8-bit timer/event counter is used as 16-bit timer/event counter minimum pulse width maximum pulse width resolution 2 x 1/f x (400 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 2 2 x 1/f x (800 ns) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 2 3 x 1/f x (1.6 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) 2 4 x 1/f x (3.2 s) 2 20 x 1/f x (209.7 ms) 2 4 x 1/f x (3.2 s) 2 5 x 1/f x (6.4 s) 2 21 x 1/f x (419.4 ms) 2 5 x 1/f x (6.4 s) 2 6 x 1/f x (12.8 s) 2 22 x 1/f x (838.9 ms) 2 6 x 1/f x (12.8 s) 2 7 x 1/f x (25.6 s) 2 23 x 1/f x (1.7 s) 2 7 x 1/f x (25.6 s) 2 8 x 1/f x (51.2 s) 2 24 x 1/f x (3.4 s) 2 8 x 1/f x (51.2 s) 2 9 x 1/f x (102.4 s) 2 25 x 1/f x (6.7 s) 2 9 x 1/f x (102.4 s) 2 10 x 1/f x (204.8 s) 2 26 x 1/f x (13.4 s) 2 10 x 1/f x (204.8 s) 2 12 x 1/f x (819.2 s) 2 28 x 1/f x (53.7 s) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 150 user? manual u11302ej4v0um 7.2 8-bit timer/event counter configuration the 8-bit timer/event counter consists of the following hardware. table 7-5. 8-bit timer/event counter configuration item configuration timer register 8 bits x 2 (tm1, tm2) registers 8-bit compare register: 2 (cr10, cr20) timer outputs 2 (to1, to2) control registers timer clock select register 1 (tcl1) 8-bit timer mode control register (tmc1) 8-bit timer output control register (toc1) port mode register 3 (pm3) note note refer to figure 4-7 block diagram of p30 to p37.
chapter 7 8-bit timer/event counter 151 user? manual u11302ej4v0um figure 7-1. block diagram of 8-bit timer/event counter note refer to figures 7-2 and 7-3 for details of 8-bit timer/event counter output controllers 1 and 2, respectively. internal bus 8-bit compare register (cr20) match 8-bit timer register 2 (tm2) clear inttm1 8-bit timer/ event counter output controller 2 to2/p32 inttm2 to1/p31 note 8-bit timer/ event counter output controller 1 8-bit compare register (cr10) 8-bit timer register 1 (tm1) match clear selector selector selector selector selector 4 4 4 fx/2 2 to fx/2 10 fx/2 12 ti1/p33 tcl 17 tcl 16 tcl 15 tcl 14 tcl 13 tcl 12 tcl 11 tcl 10 timer clock select register 1 8-bit timer mode control register tmc12 tce2 tce1 toc 15 lvs2 lvr2 toe2 lvs1 lvr1 toc 11 toe1 8-bit timer output control register internal bus 4 note fx/2 2 to fx/2 10 fx/2 12 ti2/p34
chapter 7 8-bit timer/event counter 152 user s manual u11302ej4v0um note bit 1 of port mode register 3 (pm3) remark the circuitry enclosed by the dotted line is the output controller. figure 7-3. block diagram of 8-bit timer/event counter output controller 2 note bit 2 of port mode register 3 (pm3) remarks 1. the circuitry enclosed by the dotted line is the output controller. 2. f sck : serial clock frequency figure 7-2. block diagram of 8-bit timer/event counter output controller 1 r s inv q level f/f (lv1) lvr1 lvs1 toc11 inttm1 toe1 p31 output latch pm31 note to1/p31 r s inv q level f/f (lv2) lvr2 lvs2 toc15 inttm2 toe2 p32 output latch pm32 note to2/p32 f sck
chapter 7 8-bit timer/event counter 153 user s manual u11302ej4v0um (1) 8-bit compare registers (cr10, cr20) these are 8-bit registers used to compare the value set to cr10 with the 8-bit timer register 1 (tm1) count value, and the value set to cr20 with the 8-bit timer register 2 (tm2) count value, and, if they match, generate an interrupt request (inttm1 and inttm2, respectively). cr10 and cr20 are set with an 8-bit memory manipulation instruction. they cannot be set with a 16-bit memory manipulation instruction. when the compare register is used as an 8-bit timer/event counter, values from 00h to ffh can be set. when the compare register is used as a 16-bit timer/event counter, values from 0000h to ffffh can be set. reset input makes cr10 and cr20 undefined. cautions 1. when using the compare register as a 16-bit timer/event counter, be sure to set data after stopping timer operation. 2. when the values of cr10 and cr20 after changing are smaller than those of the 8-bit timer registers (tm1, tm2), tm1 and tm2 continue to count. when they overflow, counting starts again from 0. therefore, it is necessary to restart the timer after changing the values of cr10 and cr20 if the values of cr10 and cr20 are smaller than the values before changing. (2) 8-bit timer registers 1, 2 (tm1, tm2) these are 8-bit registers used to count count pulses. when tm1 and tm2 are used in the separate mode, they should be read with an 8-bit memory manipulation instruction. when tm1 and tm2 are used in 16-bit timer mode, the 16-bit timer register (tms) should be read with a 16-bit memory manipulation instruction. reset input sets tm1 and tm2 to 00h. 7.3 8-bit timer/event counter control registers the following four registers are used to control the 8-bit timer/event counter. timer clock select register 1 (tcl1) 8-bit timer mode control register (tmc1) 8-bit timer output control register (toc1) port mode register 3 (pm3) (1) timer clock select register 1 (tcl1) this register sets the count clock of 8-bit timer registers 1 and 2. tcl1 is set with an 8-bit memory manipulation instruction. reset input sets tcl1 to 00h.
chapter 7 8-bit timer/event counter 154 user s manual u11302ej4v0um figure 7-4. format of timer clock select register 1 caution if tcl1 is to be rewritten with data other than identical data, the timer operation must be stopped first. remarks 1. f x : main system clock oscillation frequency 2. ti1: 8-bit timer register 1 input pin 3. ti2: 8-bit timer register 2 input pin 4. figures in parentheses apply to operation with f x = 5.0 mhz. tcl10 tcl1 765432 symbol 10 tcl13 8-bit timer register 1 count clock selection ff41h tcl11 tcl13 tcl12 tcl14 tcl15 tcl16 tcl17 address after reset r/w 00h r/w 0 ti1 falling edge 0 ti1 rising edge 0 f x /2 (2.5 mhz) 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) 1 f x /2 10 (4.9 khz) 1 f x /2 12 (1.2 khz) setting prohibited tcl12 0 0 1 1 1 0 0 0 0 1 1 1 1 tcl11 0 0 0 1 1 0 0 1 1 0 0 1 1 other than above tcl10 0 1 1 0 1 0 1 0 1 0 1 0 1 tcl17 8-bit timer register 2 count clock selection 0 ti2 falling edge 0 ti2 rising edge 0 f x /2 (2.5 mhz) 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) 1 f x /2 10 (4.9 khz) 1 f x /2 12 (1.2 khz) setting prohibited tcl16 0 0 1 1 1 0 0 0 0 1 1 1 1 tcl15 0 0 0 1 1 0 0 1 1 0 0 1 1 other than above tcl14 0 1 1 0 1 0 1 0 1 0 1 0 1
chapter 7 8-bit timer/event counter 155 user s manual u11302ej4v0um (2) 8-bit timer mode control register (tmc1) this register enables/stops operation of 8-bit timer registers 1 and 2 and sets the operating mode of 8- bit timer registers 1 and 2. tmc1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets tmc1 to 00h. figure 7-5. format of 8-bit timer mode control register cautions 1. switch the operating mode after stopping timer operation. 2. when used as 16-bit timer register (tms), tce1 should be used for operation enable/stop. 7 6 5 4 3 2 <1> <0> 00000 tmc12 tce2 tce1 symbol tmc1 address ff49h after reset 00h r/w r/w tce1 0 1 8-bit timer register 1 operation control operation stopped (tm1 cleared to 0) operation enabled tce2 0 1 8-bit timer register 2 operation control operation stopped (tm2 cleared to 0) operation enabled tmc12 0 1 operating mode selection 8-bit timer register x 2-channel mode (tm1, tm2) 16-bit timer register x 1-channel mode (tms)
chapter 7 8-bit timer/event counter 156 user s manual u11302ej4v0um (3) 8-bit timer output control register (toc1) this register controls operation of 8-bit timer/event counter output controllers 1 and 2. it sets/resets the r-s flip-flops (lv1 and lv2) and enables/disables inversion and 8-bit timer output of 8- bit timer registers 1 and 2. toc1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets toc1 to 00h. figure 7-6. format of 8-bit timer output control register cautions 1. be sure to set toc1 after stopping timer operation. 2. after data setting, 0 is read from lvs1, lvs2, lvr1, and lvr2. <7> <6> 5 <4> <3> <2> 1 <0> lvs2 lvr2 toc15 toe2 lvs1 lvr1 toc11 toe1 symbol toc1 address ff4fh after reset 00h r/w r/w toe1 0 1 8-bit timer/event counter 1 output control output disabled (port mode) output enabled toc11 0 1 8-bit timer/event counter 1 timer output f/f control inverted operation disabled inverted operation enabled lvs1 0 0 1 1 unchanged timer output f/f reset (0) timer output f/f set (1) setting prohibited toe2 0 1 8-bit timer/event counter 2 output control output disabled (port mode) output enabled toc15 0 1 8-bit timer/event counter 2 timer output f/f control inverted operation disabled inverted operation enabled lvr1 0 1 0 1 8-bit timer/event counter 1 timer output f/f status setting lvs2 0 0 1 1 unchanged timer output f/f reset (0) timer output f/f set (1) setting prohibited lvr2 0 1 0 1 8-bit timer/event counter 2 timer output f/f status setting
chapter 7 8-bit timer/event counter 157 user s manual u11302ej4v0um (4) port mode register 3 (pm3) this register sets port 3 input/output in 1-bit units. when using the p31/to1 and p32/to2 pins for timer output, set pm31, pm32, and the output latches of p31 and p32 to 0. pm3 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pm3 to ffh. figure 7-7. format of port mode register 3 7654 321 0 pm37 pm36 pm35 pm34 pm33 pm32 pm31 pm30 symbol pm3 address ff23h after reset ffh r/w r/w pm3n 0 1 p3n pin i/o mode selection (n = 0 to 7) output mode (output buffer on) input mode (output buffer off)
chapter 7 8-bit timer/event counter 158 user s manual u11302ej4v0um remark interval time = (n + 1) x t: n = 00h to ffh 7.4 8-bit timer/event counter operations 7.4.1 8-bit timer/event counter mode (1) interval timer operations the 8-bit timer/event counter operates as an interval timer that generates interrupt requests repeatedly at intervals of the count value preset to the 8-bit compare registers (cr10 and cr20). when the count values of 8-bit timer registers 1 and 2 (tm1 and tm2) match the values set to cr10 and cr20, counting continues with the tm1 and tm2 values cleared to 0 and interrupt request signals (inttm1 and inttm2) are generated. the count clock of tm1 can be selected using bits 0 to 3 (tcl10 to tcl13) of timer clock select register 1 (tcl1). the count clock of tm2 can be selected using bits 4 to 7 (tcl14 to tcl17) of timer clock select register 1 (tcl1). for the operation when the value of the compare register is changed during timer count operation, refer to 7.5 8-bit timer/event counter operating precautions (3) . figure 7-8. interval timer operation timing t 00 tm1 count value count clock cr10 inttm1 to1 01 n 00 01 n 00 01 n count start clear clear interrupt request acknowledgment nn nn interrupt request acknowledgment interval time interval time interval time
chapter 7 8-bit timer/event counter 159 user s manual u11302ej4v0um table 7-6. 8-bit timer/event counter 1 interval time tcl13 tcl12 tcl11 tcl10 minimum interval time maximum interval time resolution 0000 ti1 input cycle 2 8 x ti1 input cycle ti1 input edge cycle 0001 ti1 input cycle 2 8 x ti1 input cycle ti1 input edge cycle 01012 x 1/f x (400 ns) 2 9 x 1/f x (102.4 s) 2 x 1/f x (400 ns) 01102 2 x 1/f x (800 ns) 2 10 x 1/f x (204.8 s) 2 2 x 1/f x (800 ns) 01112 3 x 1/f x (1.6 s) 2 11 x 1/f x (409.6 s) 2 3 x 1/f x (1.6 s) 10002 4 x 1/f x (3.2 s) 2 12 x 1/f x (819.2 s) 2 4 x 1/f x (3.2 s) 10012 5 x 1/f x (6.4 s) 2 13 x 1/f x (1.64 ms) 2 5 x 1/f x (6.4 s) 10102 6 x 1/f x (12.8 s) 2 14 x 1/f x (3.28 ms) 2 6 x 1/f x (12.8 s) 10112 7 x 1/f x (25.6 s) 2 15 x 1/f x (6.55 ms) 2 7 x 1/f x (25.6 s) 11002 8 x 1/f x (51.2 s) 2 16 x 1/f x (13.1 ms) 2 8 x 1/f x (51.2 s) 11012 9 x 1/f x (102.4 s) 2 17 x 1/f x (26.2 ms) 2 9 x 1/f x (102.4 s) 11102 10 x 1/f x (204.8 s) 2 18 x 1/f x (52.4 ms) 2 10 x 1/f x (204.8 s) 11112 12 x 1/f x (819.2 s) 2 20 x 1/f x (209.7 ms) 2 12 x 1/f x (819.2 s) other than above setting prohibited remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. table 7-7. 8-bit timer/event counter 2 interval time tcl17 tcl16 tcl15 tcl14 minimum interval time maximum interval time resolution 0000 ti2 input cycle 2 8 x ti2 input cycle ti2 input edge cycle 0001 ti2 input cycle 2 8 x ti2 input cycle ti2 input edge cycle 01012 x 1/f x (400 ns) 2 9 x 1/f x (102.4 s) 2 x 1/f x (400 ns) 01102 2 x 1/f x (800 ns) 2 10 x 1/f x (204.8 s) 2 2 x 1/f x (800 ns) 01112 3 x 1/f x (1.6 s) 2 11 x 1/f x (409.6 s) 2 3 x 1/f x (1.6 s) 10002 4 x 1/f x (3.2 s) 2 12 x 1/f x (819.2 s) 2 4 x 1/f x (3.2 s) 10012 5 x 1/f x (6.4 s) 2 13 x 1/f x (1.64 ms) 2 5 x 1/f x (6.4 s) 10102 6 x 1/f x (12.8 s) 2 14 x 1/f x (3.28 ms) 2 6 x 1/f x (12.8 s) 10112 7 x 1/f x (25.6 s) 2 15 x 1/f x (6.55 ms) 2 7 x 1/f x (25.6 s) 11002 8 x 1/f x (51.2 s) 2 16 x 1/f x (13.1 ms) 2 8 x 1/f x (51.2 s) 11012 9 x 1/f x (102.4 s) 2 17 x 1/f x (26.2 ms) 2 9 x 1/f x (102.4 s) 11102 10 x 1/f x (204.8 s) 2 18 x 1/f x (52.4 ms) 2 10 x 1/f x (204.8 s) 11112 12 x 1/f x (819.2 s) 2 20 x 1/f x (209.7 ms) 2 12 x 1/f x (819.2 s) other than above setting prohibited remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 160 user s manual u11302ej4v0um (2) external event counter operation the external event counter counts the number of external clock pulses input to the ti1/p33 and ti2/p34 pins using 8-bit timer registers 1 and 2 (tm1 and tm2). tm1 and tm2 are incremented each time the valid edge specified by timer clock select register 1 (tcl1) is input. either the rising or falling edge can be selected. when the tm1 and tm2 count values match the values of the 8-bit compare registers (cr10 and cr20), tm1 and tm2 are cleared to 0 and interrupt request signals (inttm1 and inttm2) are generated. figure 7-9. external event counter operation timing (with rising edge specified) remark n = 00h to ffh ti1 pin input tm1 count value cr10 inttm1 00 01 02 03 04 05 n 1 n n00010203
chapter 7 8-bit timer/event counter 161 user s manual u11302ej4v0um (3) square-wave output operation the 8-bit timer/event counter outputs a square wave of any frequency with the value preset to the 8-bit compare register (cr10, cr20) as the interval. the to1/p31 or to2/p32 pin output status is reversed at intervals of the count value preset to cr10 or cr20 by setting bit 0 (toe1) or bit 4 (toe2) of the 8-bit timer output control register (toc1) to 1. this enables a square wave with any selected frequency to be output. table 7-8. 8-bit timer/event counter square-wave output ranges tcl13 tcl12 tcl11 tcl10 minimum pulse width maximum pulse width resolution 01012 x 1/f x (400 ns) 2 9 x 1/f x (102.4 s) 2 x 1/f x (400 ns) 01102 2 x 1/f x (800 ns) 2 10 x 1/f x (204.8 s) 2 2 x 1/f x (800 ns) 01112 3 x 1/f x (1.6 s) 2 11 x 1/f x (409.6 s) 2 3 x 1/f x (1.6 s) 10002 4 x 1/f x (3.2 s) 2 12 x 1/f x (819.2 s) 2 4 x 1/f x (3.2 s) 10012 5 x 1/f x (6.4 s) 2 13 x 1/f x (1.64 ms) 2 5 x 1/f x (6.4 s) 10102 6 x 1/f x (12.8 s) 2 14 x 1/f x (3.28 ms) 2 6 x 1/f x (12.8 s) 10112 7 x 1/f x (25.6 s) 2 15 x 1/f x (6.55 ms) 2 7 x 1/f x (25.6 s) 11002 8 x 1/f x (51.2 s) 2 16 x 1/f x (13.1 ms) 2 8 x 1/f x (51.2 s) 11012 9 x 1/f x (102.4 s) 2 17 x 1/f x (26.2 ms) 2 9 x 1/f x (102.4 s) 11102 10 x 1/f x (204.8 s) 2 18 x 1/f x (52.4 ms) 2 10 x 1/f x (204.8 s) 11112 12 x 1/f x (819.2 s) 2 20 x 1/f x (209.7 ms) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. tcl10 to tcl13: bits 0 to 3 of timer clock select register 1 (tcl1) 3. figures in parentheses apply to operation with f x = 5.0 mhz. figure 7-10. square-wave output operation timing note initial value of to1 output can be set using bits 2 and 3 (lvr1 and lvs1) of the 8-bit timer output control register (toc1). 00 tm1 count value count clock 01 n 1 n n 1 n 00 to1 note 02 00 01 02 cr10 count start nn
chapter 7 8-bit timer/event counter 162 user s manual u11302ej4v0um 7.4.2 16-bit timer/event counter mode when bit 2 (tmc12) of the 8-bit timer mode control register (tmc1) is set to 1, the 16-bit timer/event counter mode is set. in this mode, the count clock is selected using bits 0 to 3 (tcl10 to tcl13) of the timer clock select register (tcl1). the overflow signal of 8-bit timer/event counter 1 (tm1) is used as the count clock of 8-bit timer/event counter 2 (tm2). count operation enable/disable in this mode is selected using bit 0 (tce1) of tmc1. (1) interval timer operations the 8-bit timer/event counter operates as an interval timer that generates interrupt requests repeatedly at intervals of the count value preset to the 8-bit compare registers (cr10 and cr20). when setting a count value, set the value of the higher 8 bits to cr20 and the value of the lower 8 bits to cr10. for the count value (interval time) that can be set, refer to table 7-9 . when the 8-bit timer register 1 (tm1) and cr10 values match and the 8-bit timer register 2 (tm2) and cr20 values match, counting continues with the tm1 and tm2 values cleared to 0 and the interrupt request signal (inttm2) is generated. for the operation timing of the interval timer, refer to figure 7-11 . the count clock can be selected using bits 0 to 3 (tcl10 to tcl13) of the timer clock select register (tcl1). the overflow signal of tm1 is used as the count clock of tm2. figure 7-11. interval timer operation timing remark interval time = (n + 1) x t: n = 0000h to ffffh t 0000 tms (tm1, tm2) count value count clock cr10, cr20 inttm2 to2 0001 n 0000 0001 n 0000 0001 n count start clear clear interrupt request acknowledgment nn nn interrupt request acknowledgment interval time interval time interval time
chapter 7 8-bit timer/event counter 163 user s manual u11302ej4v0um caution even if the 16-bit timer/event counter mode is used, when the tm1 count value matches the cr10 value, an interrupt request (inttm1) is generated and the f/f of 8-bit timer/event counter output controller 1 is inverted. thus, when using the 8-bit timer/event counter as a 16-bit interval timer, set the mask flag tmmk1 to 1 to disable inttm1 acknowledgment. when reading the 16-bit timer register (tms) count value, use a 16-bit memory manipulation instruction. table 7-9. interval time when 2-channel 8-bit timer/event counter (tm1 and tm2) is used as 16-bit timer/event counter tcl13 tcl12 tcl11 tcl10 minimum interval time maximum interval time resolution 0000 ti1 input cycle 2 8 x ti1 input cycle ti1 input edge cycle 0001 ti1 input cycle 2 8 x ti1 input cycle ti1 input edge cycle 01012 x 1/f x (400 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 01102 2 x 1/f x (800 ns) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 01112 3 x 1/f x (1.6 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) 10002 4 x 1/f x (3.2 s) 2 20 x 1/f x (209.7 ms) 2 4 x 1/f x (3.2 s) 10012 5 x 1/f x (6.4 s) 2 21 x 1/f x (419.4 ms) 2 5 x 1/f x (6.4 s) 10102 6 x 1/f x (12.8 s) 2 22 x 1/f x (838.9 ms) 2 6 x 1/f x (12.8 s) 10112 7 x 1/f x (25.6 s) 2 23 x 1/f x (1.7 s) 2 7 x 1/f x (25.6 s) 11002 8 x 1/f x (51.2 s) 2 24 x 1/f x (3.4 s) 2 8 x 1/f x (51.2 s) 11012 9 x 1/f x (102.4 s) 2 25 x 1/f x (6.7 s) 2 9 x 1/f x (102.4 s) 11102 10 x 1/f x (204.8 s) 2 26 x 1/f x (13.4 s) 2 10 x 1/f x (204.8 s) 11112 12 x 1/f x (819.2 s) 2 28 x 1/f x (53.7 s) 2 12 x 1/f x (819.2 s) other than above setting prohibited remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz.
chapter 7 8-bit timer/event counter 164 user s manual u11302ej4v0um (2) external event counter operations the external event counter counts the number of external clock pulses input to the ti1/p33 pin by using the two channels of 8-bit timer registers 1 and 2 (tm1 and tm2). tm1 is incremented each time the valid edge specified by timer clock select register 1 (tcl1) is input. if tm1 overflows as a result, the overflow signal is used as the count clock, and tm2 is incremented. either the rising or falling edge can be selected. when the count value of tm1 and tm2 matches the value of the 8-bit compare registers (cr10 and cr20), both tm1 and tm2 are cleared to 0 and the interrupt request signal (inttm2) is generated. figure 7-12. external event counter operation timing (with rising edge specified) caution even in the 16-bit timer/event counter mode, an interrupt request (inttm1) will be generated when the tm1 count value matches the cr10 value, inverting the flip-flop of 8-bit timer/event counter output controller 1. thus, when using the 8-bit timer/event counters as a 16-bit interval timer, set the mask flag tmmk1 to 1 to disable inttm1 acknowledgment. when reading the 16-bit timer register (tms) count value, use a 16-bit memory manipulation instruction. ti1 pin input tms (tm1, tm2) count value cr10, cr20 inttm2 0000 0001 0002 0003 0004 0005 n 1 n n 0000 0001 0002 0003
chapter 7 8-bit timer/event counter 165 user s manual u11302ej4v0um (3) square-wave output operation square-wave signals can be generated at the user-specified frequency. the frequency or pulse interval is determined by the value preset in the 8-bit compare registers (cr10 and cr20). to set a count value, set the value of the higher 8 bits to cr20, and the value of the lower 8 bits to cr10. the to2/p32 pin output status is reversed at intervals of the count value preset to cr10 and cr20 by setting bit 4 (toe2) of the 8-bit timer output control register (toc1) to 1. this enables a square wave with any selected frequency to be output. table 7-10. square-wave output ranges when 2-channel 8-bit timer/event counters (tm1 and tm2) are used as 16-bit timer/event counter tcl13 tcl12 tcl11 tcl10 minimum pulse width maximum pulse width resolution 01012 x 1/f x (400 ns) 2 17 x 1/f x (26.2 ms) 2 x 1/f x (400 ns) 01102 2 x 1/f x (800 ns) 2 18 x 1/f x (52.4 ms) 2 2 x 1/f x (800 ns) 01112 3 x 1/f x (1.6 s) 2 19 x 1/f x (104.9 ms) 2 3 x 1/f x (1.6 s) 10002 4 x 1/f x (3.2 s) 2 20 x 1/f x (209.7 ms) 2 4 x 1/f x (3.2 s) 10012 5 x 1/f x (6.4 s) 2 21 x 1/f x (419.4 ms) 2 5 x 1/f x (6.4 s) 10102 6 x 1/f x (12.8 s) 2 22 x 1/f x (838.9 ms) 2 6 x 1/f x (12.8 s) 10112 7 x 1/f x (25.6 s) 2 23 x 1/f x (1.7 s) 2 7 x 1/f x (25.6 s) 11002 8 x 1/f x (51.2 s) 2 24 x 1/f x (3.4 s) 2 8 x 1/f x (51.2 s) 11012 9 x 1/f x (102.4 s) 2 25 x 1/f x (6.7 s) 2 9 x 1/f x (102.4 s) 11102 10 x 1/f x (204.8 s) 2 26 x 1/f x (13.4 s) 2 10 x 1/f x (204.8 s) 11112 12 x 1/f x (819.2 s) 2 28 x 1/f x (53.7 s) 2 12 x 1/f x (819.2 s) remarks 1. f x : main system clock oscillation frequency 2. tcl10 to tcl13: bits 0 to 3 of timer clock select register 1 (tcl1) 3. figures in parentheses apply to operation with f x = 5.0 mhz. figure 7-13. square-wave output operation timing 00h count clock count start level reverse counter clear interval time tm1 tm2 cr10 cr20 to2 00h 01h ffh 00h 01h n m n + 1 n ffh 00h 02h ffh 00h m 1 m 01h n 00h 00h 01h
chapter 7 8-bit timer/event counter 166 user s manual u11302ej4v0um 7.5 8-bit timer/event counter operating precautions (1) timer start error an error of up to one clock may occur in the time required for a match signal to be generated after timer start. this is because 8-bit timer registers 1 and 2 (tm1 and tm2) are started asynchronously to the count pulse. figure 7-14. 8-bit timer register start timing (2) 8-bit compare registers 1 and 2 settings the 8-bit compare registers (cr10 and cr20) can be set to 00h. thus, when an 8-bit compare register is used as an event counter, a one-pulse count operation can be carried out. when the 8-bit compare registers are used as a 16-bit timer/event counter, write data to cr10 and cr20 after setting bit 0 (tce1) of the 8-bit timer mode control register (tmc1) to 0 and stopping timer operation. figure 7-15. external event counter operation timing count pulse tm1, tm2 count value 00h timer start 01h 02h 03h 04h ti1, ti2 input cr10, cr20 tm1, tm2 count value 00h 00h 00h 00h 00h to1, to2 interrupt request signal
chapter 7 8-bit timer/event counter 167 user s manual u11302ej4v0um (3) operation after compare register change during timer count operation if the values after the 8-bit compare registers (cr10 and cr20) are changed are smaller than those of the 8-bit timer registers (tm1 and tm2), tm1 and tm2 continue counting, overflow and then restart counting from 0. thus, if the value after cr10 and cr20 (m) change is smaller than that before the change (n), it is necessary to restart the timer after changing cr10 and cr20. figure 7-16. timing after compare register change during timer count operation remark n > x > m count pulse cr10, cr20 n m tm1, tm2 count value x _ 1 x ffh 00h 01h 02h
168 user? manual u11302ej4v0um chapter 8 watch timer 8.1 watch timer functions the watch timer has the following functions. watch timer interval timer the watch timer and the interval timer can be used simultaneously. (1) watch timer when the 32.768 khz subsystem clock is used, a flag (wtif) is set at 0.5-second or 0.25-second intervals. in addition, when the 4.19 mhz (standard: 4.194304 mhz) main system clock is used, a flag (wtif) is set at 0.5-second or 1-second intervals. caution 0.5-second intervals cannot be generated with the 5.0 mhz main system clock. switch to the 32.768 khz subsystem clock to generate 0.5-second intervals. (2) interval timer interrupt requests (inttm3) are generated at the preset time interval. table 8-1. interval timer interval time interval time when operated when operated at when operated at at f x = 5.0 mhz f x = 4.19 mhz f xt = 32.768 khz 2 12 x 1/f x 819 s 978 s 488 s 2 13 x 1/f x 1.64 ms 1.96 ms 977 s 2 14 x 1/f x 3.28 ms 3.91 ms 1.95 ms 2 15 x 1/f x 6.55 ms 7.82 ms 3.91 ms 2 16 x 1/f x 13.1 ms 15.6 ms 7.81 ms 2 17 x 1/f x 26.2 ms 31.3 ms 15.6 ms f x : main system clock oscillation frequency f xt : subsystem clock oscillation frequency
chapter 8 watch timer 169 user? manual u11302ej4v0um 8.2 watch timer configuration the watch timer consists of the following hardware. table 8-2. watch timer configuration item configuration counter 5 bits x 1 control registers timer clock select register 2 (tcl2) watch timer mode control register (tmc2) 8.3 watch timer control registers the following two registers are used to control the watch timer. timer clock select register 2 (tcl2) watch timer mode control register (tmc2) (1) timer clock select register 2 (tcl2) (see figure 8-2 ) this register sets the watch timer count clock. tcl2 is set with an 8-bit memory manipulation instruction. reset input sets tcl2 to 00h. remark besides setting the watch timer count clock, tcl2 sets the watchdog timer count clock and buzzer output frequency.
chapter 8 watch timer 170 user? manual u11302ej4v0um figure 8-1. watch timer block diagram internal bus intwt inttm3 f x /2 8 f xt f w selector tcl24 timer clock select register 2 watch timer mode control register tmc21 clear prescaler selector selector 3 tmc26 tmc25 tmc24 tmc23 tmc22 tmc21 tmc20 2 4 f w 2 5 f w 2 6 f w 2 7 f w 2 8 f w 2 9 f w 2 13 f w 2 14 f w 5-bit counter clear selector
chapter 8 watch timer 171 user s manual u11302ej4v0um figure 8-2. format of timer clock select register 2 note when using a main system clock of 1.25 mhz or less and the vfd controller/driver, select f x /2 8 as the count clock for the watch timer. caution when changing the count clock, be sure to stop operation of the watch timer before rewriting tcl2 (stopping operation is not necessary when rewriting the same data). remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency 3. x: don t care 4. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. tcl20 tcl2 765432 symbol 10 tcl22 count clock selection ff42h tcl21 0 tcl22 tcl24 tcl25 tcl26 tcl27 address after reset r/w 00h r/w watchdog timer mode 0 f x /2 3 (625 khz) 0 f x /2 4 (313 khz) 0 f x /2 5 (156 khz) 0 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) 1 f x /2 11 (2.4 khz) tcl24 watch timer count clock selection note 0 f x /2 8 (19.5 khz) 1 f xt (32.768 khz) tcl27 buzzer output frequency selection 0 buzzer output disabled 1 f x /2 10 (4.9 khz) 1 f x /2 11 (2.4 khz) 1 f x /2 12 (1.2 khz) 1 setting prohibited interval timer mode f x /2 4 (313 khz) f x /2 5 (156 khz) f x /2 6 (78.1 khz) f x /2 7 (39.1 khz) f x /2 8 (19.5 khz) f x /2 9 (9.8 khz) f x /2 10 (4.9 khz) f x /2 12 (1.2 khz) tcl21 0 0 1 1 0 0 1 1 tcl20 0 1 0 1 0 1 0 1 tcl26 0 0 1 1 tcl25 0 1 0 1
chapter 8 watch timer 172 user s manual u11302ej4v0um note do not frequently clear the prescaler when using the watch timer. remarks 1. f w : watch timer clock frequency (f x /2 8 or f xt ) 2. figures in parentheses apply to operation with f w = 32.768 khz. (2) watch timer mode control register (tmc2) this register sets the watch timer operating mode, watch flag set time and prescaler interval time and enables/disables prescaler and 5-bit counter operations. tmc2 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets tmc2 to 00h. figure 8-3. format of watch timer mode control register 76543210 0 tmc26 tmc25 tmc24 tmc23 tmc22 tmc21 tmc20 symbol tmc2 address ff4ah after reset 00h r/w r/w tmc21 0 1 prescaler operation control note clear after operation stops operation enable tmc22 0 1 5-bit counter o peration control clear after operation stops operation enable tmc23 0 1 0 1 tmc20 0 1 watch flag set time selection tmc26 0 0 0 0 1 1 prescaler interval time selection 2 4 /f w (488 s) setting prohibited tmc25 0 0 1 1 0 0 other than above 2 14 /f w (0.5 s) tmc24 0 1 0 1 0 1 2 5 /f w (977 s) 2 13 /f w (0.25 s) 2 4 /f w (488 s) 2 9 /f w (15.6 ms) 2 8 /f w (7.81 ms) 2 7 /f w (3.91 ms) 2 6 /f w (1.95 ms) 2 5 /f w (977 s)
chapter 8 watch timer 173 user s manual u11302ej4v0um 8.4 watch timer operations 8.4.1 watch timer operation when the 32.768 khz subsystem clock is used, the timer operates as a watch timer with a 0.5-second or 0.25- second interval. in addition, when the 4.19 mhz main system clock is used, the timer can operate as a watch timer with a 0.5-second or 1-second interval. the watch timer sets the test input flag (wtif) to 1 at a constant time interval. the standby state (stop mode/ halt mode) can be cleared by setting wtif to 1. when bit 2 (tmc22) of the watch timer mode control register (tmc2) is set to 0, the 5-bit counter is cleared and the count operation stops. for simultaneous operation of the interval timer, zero-second start can be achieved by setting tmc22 to 1 again after setting tmc22 to 0 (maximum error: 26.2 ms when operated at 5.0 mhz). 8.4.2 interval timer operation the watch timer operates as an interval timer that generates interrupt requests repeatedly at an interval of the preset count value. the interval time can be selected using bits 4 to 6 (tmc24 to tmc26) of the watch timer mode control register (tmc2). table 8-3. interval timer interval time tmc26 tmc25 tmc24 interval time when operated at when operated at when operated at f x = 5.0 mhz f x = 4.19 mhz f xt = 32.768 khz 0002 4 x 1/f w 819 s 978 s 488 s 0012 5 x 1/f w 1.64 ms 1.96 ms 977 s 0102 6 x 1/f w 3.28 ms 3.91 ms 1.95 ms 0112 7 x 1/f w 6.55 ms 7.82 ms 3.91 ms 1002 8 x 1/f w 13.1 ms 15.6 ms 7.81 ms 1012 9 x 1/f w 26.2 ms 31.3 ms 15.6 ms other than above setting prohibited f x : main system clock oscillation frequency f xt : subsystem clock oscillation frequency f w : watch timer clock frequency (f x /2 8 or f xt )
174 user? manual u11302ej4v0um chapter 9 watchdog timer 9.1 watchdog timer functions the watchdog timer has the following functions. watchdog timer interval timer caution select the watchdog timer mode or the interval timer mode using the watchdog timer mode register (wdtm) (the watchdog timer and interval timer cannot be used at the same time). (1) watchdog timer mode this mode detects an inadvertent program loop. upon detection of the program loop, a non-maskable interrupt request or reset can be generated. table 9-1. watchdog timer program loop detection time program loop when operated at program loop when operated at detection time f x = 5.0 mhz detection time f x = 5.0 mhz 2 11 x 1/f x 410 s2 15 x 1/f x 6.55 ms 2 12 x 1/f x 819 s2 16 x 1/f x 13.1 ms 2 13 x 1/f x 1.64 ms 2 17 x 1/f x 26.2 ms 2 14 x 1/f x 3.28 ms 2 19 x 1/f x 104.9 ms f x : main system clock oscillation frequency (2) interval timer mode interrupt requests are generated at the preset time intervals. table 9-2. interval time interval time when operated interval time when operated at at f x = 5.0 mhz f x = 5.0 mhz 2 12 x 1/f x 819 s2 16 x 1/f x 13.1 ms 2 13 x 1/f x 1.64 ms 2 17 x 1/f x 26.2 ms 2 14 x 1/f x 3.28 ms 2 18 x 1/f x 52.4 ms 2 15 x 1/f x 6.55 ms 2 20 x 1/f x 210 ms f x : main system clock oscillation frequency
chapter 9 watchdog timer 175 user? manual u11302ej4v0um 9.2 watchdog timer configuration the watchdog timer consists of the following hardware. table 9-3. watchdog timer configuration item configuration control registers timer clock select register 2 (tcl2) watchdog timer mode register (wdtm)
chapter 9 watchdog timer 176 user? manual u11302ej4v0um figure 9-1. watchdog timer block diagram intwdt intwdt f wdt 8-bit prescaler selector 8-bit counter tcl22 tcl21 tcl20 internal bus timer clock select register 2 watchdog timer mode register 3 2 2 2 3 2 4 2 5 2 6 2 8 f wdt 2 wdtm4 run wdtm3 run controller internal bus tmif4 tmmk4 maskable interrupt request non-maskable interrupt request reset selector clear 2 4 f x 2 3 f x f wdt f wdt f wdt f wdt f wdt f wdt
chapter 9 watchdog timer 177 user s manual u11302ej4v0um 9.3 watchdog timer control registers the following two registers are used to control the watchdog timer. timer clock select register 2 (tcl2) watchdog timer mode register (wdtm) (1) timer clock select register 2 (tcl2) this register sets the watchdog timer count clock. tcl2 is set with an 8-bit memory manipulation instruction. reset input sets tcl2 to 00h. remark besides setting the watchdog timer count clock, tcl2 sets the watch timer count clock and buzzer output clock.
chapter 9 watchdog timer 178 user s manual u11302ej4v0um figure 9-2. format of timer clock select register 2 note f x /2 8 must be selected as the watch timer count clock when using a main system clock of 1.25 mhz or less and the vfd controller/driver. caution changing the count clock (rewriting tcl20 to tcl22) after watchdog timer operation has started is prohibited. remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency 3. x: don t care 4. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. tcl20 tcl2 765432 symbol 10 tcl22 count clock selection ff42h tcl21 0 tcl22 tcl24 tcl25 tcl26 tcl27 address after reset r/w 00h r/w watchdog timer mode 0 f x /2 3 (625 khz) 0 f x /2 4 (313 khz) 0 f x /2 5 (156 khz) 0 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) 1 f x /2 11 (2.4 khz) tcl24 watch timer count clock selection note 0 f x /2 8 (19.5 khz) 1 f xt (32.768 khz) tcl27 buzzer output frequency selection 0 buzzer output disabled 1 f x /2 10 (4.9 khz) 1 f x /2 11 (2.4 khz) 1 f x /2 12 (1.2 khz) 1 setting prohibited interval timer mode f x /2 4 (313 khz) f x /2 5 (156 khz) f x /2 6 (78.1 khz) f x /2 7 (39.1 khz) f x /2 8 (19.5 khz) f x /2 9 (9.8 khz) f x /2 10 (4.9 khz) f x /2 12 (1.2 khz) tcl21 0 0 1 1 0 0 1 1 tcl20 0 1 0 1 0 1 0 1 tcl26 x 0 0 1 1 tcl25 x 0 1 0 1
chapter 9 watchdog timer 179 user s manual u11302ej4v0um (2) watchdog timer mode register (wdtm) this register sets the watchdog timer operating mode and enables/disables counting. wdtm is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets wdtm to 00h. figure 9-3. format of watchdog timer mode register notes 1. once set to 1, wdtm3 and wdtm4 cannot be cleared to 0 by software. 2. starts operation as an interval timer as soon as run is set to 1. 3. once set to 1, run cannot be cleared to 0 by software. thus, once counting starts, it can only be stopped by reset input. cautions 1. when run is set to 1 so that the watchdog timer is cleared, the actual overflow time is up to 0.5% shorter than the time set by timer clock select register 2 (tcl2). 2. when using watchdog timer mode 1 and 2, make sure that the interrupt request flag (tmif4) is set to 0 before setting wdtm4 to 1. if wdtm4 is set to 1 while tmif4 is 1, a non-maskable interrupt request occurs regardless of the contents of wdtm3. remark x: don t care <7> 6 5 4 3 2 1 0 run 0 0 wdtm4 wdtm3 00 0 symbol wdtm address fff9h after reset 00h r/w r/w wdtm4 0 1 1 watchdog timer operating mode selection note 1 interval timer mode note 2 (maskable interrupt request occurs upon generation of an overflow.) watchdog timer mode 1 (non-maskable interrupt request occurs upon generation of an overflow.) watchdog timer mode 2 (reset operation is activated upon generation of an overflow.) run 0 1 watchdog timer operation selection note 3 count stop counter is cleared and counting starts. wdtm3 x 0 1
chapter 9 watchdog timer 180 user s manual u11302ej4v0um 9.4 watchdog timer operations 9.4.1 watchdog timer operation when bit 4 (wdtm4) of the watchdog timer mode register (wdtm) is set to 1, the watchdog timer operates to detect an inadvertent program loop. the watchdog timer count clock (program loop detection time interval) can be selected using bits 0 to 2 (tcl20 to tcl22) of timer clock select register 2 (tcl2). the watchdog timer starts by setting bit 7 (run) of wdtm to 1. after the watchdog timer is started, set run to 1 within the set program loop detection time interval. the watchdog timer can be cleared and counting is started by setting run to 1. if run is not set to 1 and the program loop detection time elapses, a system reset or a non- maskable interrupt request is generated according to the value of wdtm bit 3 (wdtm3). the watchdog timer continues operating in the halt mode but it stops in the stop mode. thus, set run to 1 before the stop mode is set, clear the watchdog timer and then execute the stop instruction. cautions 1. the actual program loop detection time may be shorter than the set time by a maximum of 0.5%. 2. when the subsystem clock is selected for the cpu clock, the watchdog timer count operation is stopped. table 9-4. watchdog timer program loop detection time tcl22 tcl21 tcl20 program loop detection time f x = 5.0 mhz 0002 11 x 1/f x 410 s 0012 12 x 1/f x 819 s 0102 13 x 1/f x 1.64 ms 0112 14 x 1/f x 3.28 ms 1002 15 x 1/f x 6.55 ms 1012 16 x 1/f x 13.1 ms 1102 17 x 1/f x 26.2 ms 1112 19 x 1/f x 105.0 ms f x : main system clock oscillation frequency
chapter 9 watchdog timer 181 user s manual u11302ej4v0um 9.4.2 interval timer operation the watchdog timer operates as an interval timer that generates interrupt requests repeatedly at intervals of the preset count value when bit 4 (wdtm4) of the watchdog timer mode register (wdtm) is cleared to 0. the count clock (interval time) can be selected by bits 0 to 2 (tcl20 to tcl22) of timer clock select register 2 (tcl2). by setting bit 7 (run) of wdtm to 1, the watchdog timer starts operation as an interval timer. when the watchdog timer operates as an interval timer, the interrupt mask flag (tmmk4) and priority specification flag (tmpr4) are validated and a maskable interrupt request (intwdt) can be generated. among the maskable interrupt requests, intwdt has the highest default priority. the interval timer continues operating in the halt mode but it stops in the stop mode. thus, set run to 1 before the stop mode is set, clear the interval timer and then execute the stop instruction. cautions 1. once bit 4 (wdtm4) of wdtm is set to 1 (with the watchdog timer mode selected), the interval timer mode is not set unless reset input is applied. 2. the interval time just after setting by wdtm may be shorter than the set time by a maximum of 0.5%. 3. when the subsystem clock is selected for the cpu clock, the watchdog timer count operation is stopped. table 9-5. interval timer interval time tcl22 tcl21 tcl20 interval time f x = 5.0 mhz 0002 12 x 1/f x 819 s 0012 13 x 1/f x 1.64 ms 0102 14 x 1/f x 3.28 ms 0112 15 x 1/f x 6.55 ms 1002 16 x 1/f x 13.1 ms 1012 17 x 1/f x 26.2 ms 1102 18 x 1/f x 52.4 ms 1112 20 x 1/f x 210.0 ms f x : main system clock oscillation frequency
182 user? manual u11302ej4v0um chapter 10 clock output controller 10.1 clock output controller functions the clock output controller is used for carrier output during remote controlled transmission and clock output for supply to a peripheral lsi. the clock selected by timer clock select register 0 (tcl0) is output from the pcl/ p35 pin. follow the procedure below to output clock pulses. [1] select the clock pulse output frequency (with clock pulse output disabled) using bits 0 to 3 (tcl00 to tcl03) of tcl0. [2] set the p35 output latch to 0. [3] set bit 5 (pm35) of port mode register 3 (pm3) to 0 (set to output mode). [4] set bit 7 (cloe) of tcl0 to 1. caution clock output cannot be used when the p35 output latch is set to 1. remark when clock output enable/disable is switched, the clock output controller does not output pulses with small widths (see the mark * in figure 10-1 ). figure 10-1. remote controlled output application example cloe pcl/p35 pin output **
chapter 10 clock output controller 183 user s manual u11302ej4v0um 10.2 clock output controller configuration the clock output controller consists of the following hardware. table 10-1. clock output controller configuration item configuration control registers timer clock select register 0 (tcl0) port mode register 3 (pm3) figure 10-2. clock output controller block diagram 10.3 clock output function control registers the following two registers are used to control the clock output function. timer clock select register 0 (tcl0) port mode register 3 (pm3) (1) timer clock select register 0 (tcl0) this register sets the pcl output clock. tcl0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets tcl0 to 00h. remark besides setting the pcl output clock, tcl0 sets the 16-bit timer register count clock. f x /2 3 f x /2 4 f x /2 5 f x /2 6 f x /2 7 f x /2 8 f xt selector synchronizing circuit p35 output latch 4 pcl/p35 pm35 cloe tcl03 tcl02 tcl01 tcl00 internal bus timer clock select register 0 port mode register 3
chapter 10 clock output controller 184 user s manual u11302ej4v0um figure 10-3. format of timer clock select register 0 cautions 1. the ti0/p00/intp0 pin valid edge is set by the external interrupt mode register (intm0), and the sampling clock frequency is selected by the sampling clock select register (scs). 2. when enabling pcl output, set tcl00 to tcl03, then set cloe to 1 with a 1-bit memory manipulation instruction. 3. to read the count value when ti0 has been specified as the tm0 count clock, the value should be read from tm0, not from the 16-bit capture register (cr01). 4. if tcl0 is to be rewritten with data other than identical data, the timer operation must be stopped first. remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency 3. ti0: 16-bit timer/event counter input pin 4. tm0: 16-bit timer register 5. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. tcl00 tcl0 <7>65432 symbol 10 tcl03 pcl output clock selection ff40h tcl01 tcl03 tcl02 tcl04 tcl05 tcl06 cloe address after reset r/w 00h r/w 0 f xt (32.768 khz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) setting prohibited tcl06 16-bit timer register count clock selection 0 ti0 (valid edge specifiable) 0 f x (5.0 mhz) 0 f x /2 (2.5 mhz) 0 f x /2 2 (1.25 mhz) 1 f x /2 3 (625 khz) setting prohibited cloe pcl output control 0 output disabled 1 output enabled tcl02 0 1 0 0 0 0 1 tcl01 0 1 0 0 1 1 0 other than above tcl00 0 1 0 1 0 1 0 tcl05 0 0 1 1 0 other than above tcl04 0 1 0 1 0
chapter 10 clock output controller 185 user s manual u11302ej4v0um (2) port mode register 3 (pm3) this register sets port 3 input/output in 1-bit units. when using the p35/pcl pin for clock output, set pm35 and the output latch of p35 to 0. pm3 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pm3 to ffh. figure 10-4. format of port mode register 3 7654 321 0 pm37 pm36 pm35 pm34 pm33 pm32 pm31 pm30 symbol pm3 address ff23h after reset ffh r/w r/w pm3n 0 1 p3n pin i/o mode selection (n = 0 to 7) output mode (output buffer on) input mode (output buffer off)
186 user? manual u11302ej4v0um chapter 11 buzzer output controller 11.1 buzzer output controller functions the buzzer output controller outputs a 1.2 khz, 2.4 khz, or 4.9 khz frequency square-wave. the buzzer frequency selected by timer clock select register 2 (tcl2) is output from the buz/p36 pin. follow the procedure below to output the buzzer frequency. [1] select the buzzer output frequency using bits 5 to 7 (tcl25 to tcl27) of tcl2. [2] set the p36 output latch to 0. [3] set bit 6 (pm36) of port mode register 3 (pm3) to 0 (set to output mode). caution buzzer output cannot be used when the p36 output latch is set to 1. 11.2 buzzer output controller configuration the buzzer output controller consists of the following hardware. table 11-1. buzzer output controller configuration item configuration control registers timer clock select register 2 (tcl2) port mode register 3 (pm3) figure 11-1. buzzer output controller block diagram f x /2 10 f x /2 11 f x /2 12 p36 output latch 3 buz/p36 pm36 tcl27tcl26tcl25 internal bus timer clock select register 2 port mode register 3 selector
chapter 11 buzzer output controller 187 user s manual u11302ej4v0um 11.3 buzzer output function control registers the following two registers are used to control the buzzer output function. timer clock select register 2 (tcl2) port mode register 3 (pm3) (1) timer clock select register 2 (tcl2) this register sets the buzzer output frequency. tcl2 is set with an 8-bit memory manipulation instruction. reset input sets tcl2 to 00h. remark besides setting the buzzer output frequency, tcl2 sets the watch timer count clock and the watchdog timer count clock.
chapter 11 buzzer output controller 188 user s manual u11302ej4v0um figure 11-2. format of timer clock select register 2 cautions 1. be sure to stop operation of the watch timer or buzzer to be changed before rewriting tcl2 (stopping operation is not necessary when rewriting the same data). the operation is stopped by the following methods. buzzer output: input 0 to bit 7 (tcl27) of tcl2 watch timer: input 0 to bit 2 (tmc22) of the watch timer mode control register (tmc2) 2. changing the count clock (rewriting tcl20 to tcl22) after watchdog timer operation has started is prohibited. remarks 1. f x : main system clock oscillation frequency 2. f xt : subsystem clock oscillation frequency 3. x : don t care 4. figures in parentheses apply to operation with f x = 5.0 mhz or f xt = 32.768 khz. tcl20 tcl2 765432 symbol 10 tcl22 count clock selection ff42h tcl21 0 tcl22 tcl24 tcl25 tcl26 tcl27 address after reset r/w 00h r/w watchdog timer mode 0 f x /2 3 (625 khz) 0 f x /2 4 (313 khz) 0 f x /2 5 (156 khz) 0 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) 1 f x /2 11 (2.4 khz) tcl24 watch timer count clock selection 0 f x /2 8 (19.5 khz) 1 f xt (32.768 khz) tcl27 buzzer output frequency selection 0 buzzer output disabled 1 f x /2 10 (4.9 khz) 1 f x /2 11 (2.4 khz) 1 f x /2 12 (1.2 khz) 1 setting prohibited interval timer mode f x /2 4 (313 khz) f x /2 5 (156 khz) f x /2 6 (78.1 khz) f x /2 7 (39.1 khz) f x /2 8 (19.5 khz) f x /2 9 (9.8 khz) f x /2 10 (4.9 khz) f x /2 12 (1.2 khz) tcl21 0 0 1 1 0 0 1 1 tcl20 0 1 0 1 0 1 0 1 tcl26 x 0 0 1 1 tcl25 x 0 1 0 1
chapter 11 buzzer output controller 189 user s manual u11302ej4v0um (2) port mode register 3 (pm3) this register sets port 3 input/output in 1-bit units. when using the p36/buz pin for buzzer output, set pm36 and the output latch of p36 to 0. pm3 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets pm3 to ffh. figure 11-3. format of port mode register 3 7654 321 0 pm37 pm36 pm35 pm34 pm33 pm32 pm31 pm30 symbol pm3 address ff23h after reset ffh r/w r/w pm3n 0 1 p3n pin i/o mode selection (n = 0 to 7) output mode (output buffer on) input mode (output buffer off)
190 user? manual u11302ej4v0um chapter 12 a/d converter 12.1 a/d converter functions the a/d converter converts an analog input into a digital value. it consists of 8 channels (ani0 to ani7) with an 8-bit resolution. the conversion method is based on successive approximation and the conversion result is held in the 8-bit a/d conversion result register (adcr). a/d conversion can be started in the following two ways. (1) hardware start conversion is started by trigger input (intp3). (2) software start conversion is started by setting the a/d converter mode register (adm). select one channel of analog input from ani0 to ani7 and carry out a/d conversion. in the case of a hardware start, when a/d conversion finishes, the a/d converter stops and an interrupt request (intad) is generated. in the case of a software start, the a/d conversion operation is repeated. each time an a/d conversion operation ends, an interrupt request (intad) is generated. 12.2 a/d converter configuration the a/d converter consists of the following hardware. table 12-1. a/d converter configuration item configuration analog input 8 channels (ani0 to ani7) control registers a/d converter mode register (adm) a/d converter input select register (adis) registers successive approximation register (sar) a/d conversion result register (adcr)
chapter 12 a/d converter 191 user? manual u11302ej4v0um figure 12-1. a/d converter block diagram notes 1. selector to select the number of channels to be used for analog input 2. selector to select the channel for a/d conversion internal bus ani0/p10 ani1/p11 ani2/p12 ani3/p13 ani4/p14 ani5/p15 ani6/p16 ani7/p17 a/d converter input select register 4 3 adm1 to adm3 sample & hold circuit successive approximation register (sar) tap selector voltage comparator av ref av ss av dd series resistor string intp3/p03 falling edge detector fr0 adm3 adm2 adm1 3 cs trg fr1 trigger enable controller a/d conversion result register (adcr) internal bus intad intp3 a/d converter mode register note 1 selector note 2 selector adis3 adis2 adis1 adis0 av ss
chapter 12 a/d converter 192 user s manual u11302ej4v0um (1) successive approximation register (sar) this register compares the analog input voltage value to the voltage tap (compare voltage) value applied from the series resistor string and holds the result from the most significant bit (msb). when up to the least significant bit (lsb) is held (end of a/d conversion), the sar contents are transferred to the a/d conversion result register (adcr). (2) a/d conversion result register (adcr) this register holds the a/d conversion result. each time a/d conversion ends, the conversion result is loaded from the successive approximation register (sar). adcr is read with an 8-bit memory manipulation instruction. reset input makes adcr undefined. (3) sample & hold circuit the sample & hold circuit samples each analog input signal sequentially applied from the input circuit and sends it to the voltage comparator. this circuit holds the sampled analog input voltage value during a/d conversion. (4) voltage comparator the voltage comparator compares the analog input with the series resistor string output voltage. (5) series resistor string the series resistor string is connected between av ref and av ss and generates a voltage to be compared with the analog input. (6) ani0 to ani7 pins these are 8-channel analog input pins used to input the analog signals to undergo a/d conversion to the a/d converter. except for the analog input pins selected by the a/d converter input select register (adis), these pins can be used as i/o port pins. cautions 1. use ani0 to ani7 input voltages within the specified range. if a voltage higher than or equal to av ref or lower than or equal to av ss is applied (even if within the absolute maximum ratings), the converted value of the corresponding channel becomes undefined and may adversely affect the converted values of other channels. 2. the analog input pins ani0 to ani7 also function as i/o port (port 1) pins. pins used as analog inputs should be set to the input mode. when a/d conversion is performed with any of pins ani0 to ani7 selected, be sure not to execute an instruction that inputs data to port 1 while conversion is in progress, as this may reduce the conversion resolution. also, if digital pulses are applied to a pin adjacent to the pin in the process of a/ d conversion, the expected a/d conversion value may not be obtainable due to coupling noise. therefore, avoid applying pulses to pins adjacent to the pin undergoing a/d conversion.
chapter 12 a/d converter 193 user s manual u11302ej4v0um (7) av ref pin this pin inputs the a/d converter reference voltage. it converts signals input to ani0 to ani7 into digital signals according to the voltage applied between av ref and av ss . caution a series resistor string of approximately 10 k ? is connected between the av ref pin and the av ss pin. therefore, if the output impedance of the reference voltage source is high, this will result in series connection to the series resistor string between the av ref pin and the av ss pin, and there will be a large reference voltage error. (8) av ss pin ground potential pin of the a/d converter. it must be at the same level as the v ss pin even if the a/d converter is not used. (9) av dd pin analog power supply pin of the a/d converter. it must be at the same level as the v dd pin even if the a/d converter is not used.
chapter 12 a/d converter 194 user s manual u11302ej4v0um 12.3 a/d converter control registers the following two registers are used to control the a/d converter. a/d converter mode register (adm) a/d converter input select register (adis) (1) a/d converter mode register (adm) this register sets the analog input channel for a/d conversion, conversion time, conversion start/stop, and external trigger. adm is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets adm to 01h.
chapter 12 a/d converter 195 user s manual u11302ej4v0um figure 12-2. format of a/d converter mode register adm3 adm2 adm1 analog input channel selection 0 0 0 ani0 0 0 1 ani1 0 1 0 ani2 0 1 1 ani3 1 0 0 ani4 1 0 1 ani5 1 1 0 ani6 1 1 1 ani7 fr1 fr0 a/d conversion time selection note 1 when operated at f x = 5.0 mhz when operated at f x = 4.19 mhz 0 0 160/f x (32.0 s) 160/f x (38.1 s) 0 1 80/f x (setting prohibited note 2 ) 80/f x (19.1 s) 1 0 200/f x (40.0 s) 200/f x (47.7 s) 1 1 setting prohibited trg external trigger selection 0 no external trigger (software start mode) 1 conversion started by external trigger (hardware start mode) cs a/d conversion operation control 0 operation stop 1 operation start notes 1. set so that the a/d conversion time is 19.1 s or more. 2. setting prohibited because the a/d conversion time is less than 19.1 s. cautions 1. bit 0 must be set to 1. 2. in order to reduce the power consumption of the a/d converter when the standby function is working, clear bit 7 (cs) of this register to 0 to stop the a/d conversion operation before executing the halt or stop instruction. 3. when restarting a stopped a/d conversion operation, start the a/d conversion operation after clearing the interrupt request flag (adif) to 0. remark f x : main system clock oscillation frequency <6>543210 <7> symbol adm cs trg fr1 fr0 adm3 adm2 adm1 1 ff80h 01h r/w address after reset r/w
chapter 12 a/d converter 196 user s manual u11302ej4v0um (2) a/d converter input select register (adis) this register determines whether the ani0/p10 to ani7/p17 pins should be used for analog input channels or ports. the pins that are not selected for analog input pins can be used as i/o port pins. adis is set with an 8-bit memory manipulation instruction. reset input sets adis to 00h. cautions 1. set the analog input channel using the following procedure. [1] set the number of analog input channels using adis. [2] using the a/d converter mode register (adm), select the channel to undergo a/ d conversion among the channels which were set to analog input using adis. 2. no internal pull-up resistor can be connected to the channels set to analog input using adis, irrespective of the value of bit 1 (puo1) of the pull-up resistor option register (puo). figure 12-3. format of a/d converter input select register 6543210 7 symbol adis 0 0 0 0 adis3 adis2 adis1 adis0 ff84h 00h r/w address after reset r/w adis3 0 0 0 0 analog input channel count selection no analog input channels (p10 to p17) 1 channel (ani0, p11 to p17) 2 channels (ani0, ani1, p12 to p17) adis2 0 0 0 0 adis1 0 0 1 1 0 3 channels (ani0 to ani2, p13 to p17) other than above 10 0 0 0 4 channels (ani0 to ani3, p14 to p17) 6 channels (ani0 to ani5, p16, p17) 5 channels (ani0 to ani4, p15 to p17) 1 1 1 0 1 1 100 adis0 0 1 1 0 0 1 1 0 0 setting prohibited 7 channels (ani0 to ani6, p17) 8 channels (ani0 to ani7)
chapter 12 a/d converter 197 user s manual u11302ej4v0um 12.4 a/d converter operations 12.4.1 basic operations of a/d converter [1] set the number of analog input channels using the a/d converter input select register (adis). [2] from among the analog input channels set by adis, select the channel for a/d conversion using the a/ d converter mode register (adm). [3] the sample & hold circuit samples the voltage input to the selected analog input channel. [4] sampling for the specified period of time sets the sample & hold circuit to the hold state so that the circuit holds the input analog voltage until the end of a/d conversion. [5] bit 7 of the successive approximation register (sar) is set. the tap selector sets the series resistor string voltage tap to (1/2) av ref . [6] the voltage difference between the series resistor string voltage tap and analog input is compared by the voltage comparator. if the analog input is larger than (1/2) av ref , the msb of the sar remains set. if the input is smaller than (1/2) av ref , the msb is reset. [7] next, bit 6 of the sar is automatically set and the operation proceeds to the next comparison. in this case, the series resistor string voltage tap is selected according to the preset value of bit 7 as described below. bit 7 = 1: (3/4) av ref bit 7 = 0: (1/4) av ref the voltage tap and analog input voltage are compared and bit 6 of the sar is manipulated using the result as follows. analog input voltage voltage tap: bit 6 = 1 analog input voltage < voltage tap: bit 6 = 0 [8] comparison of this sort continues up to bit 0 of the sar. [9] upon completion of the comparison of 8 bits, an effective digital result value remains in the sar and the result value is transferred to and latched in the a/d conversion result register (adcr). at the same time, the a/d conversion end interrupt request (intad) can also be generated.
chapter 12 a/d converter 198 user s manual u11302ej4v0um figure 12-4. basic operation of a/d converter a/d conversion operations are performed continuously until bit 7 (cs) of adm is reset (0) by software. if a write to adm is performed during an a/d conversion operation, the conversion operation is initialized, and if cs is set (1), conversion starts again from the beginning. reset input makes adcr undefined. a/d converter operation sar adcr intad un- defined 80h c0h or 40h conversion result conversion result sampling sampling time a/d conversion conversion time
chapter 12 a/d converter 199 user s manual u11302ej4v0um 12.4.2 input voltage and conversion results the relationship between the analog input voltage input to the analog input pins (ani0 to ani7) and the a/ d conversion result (the value stored in the a/d conversion result register (adcr)) is shown by the following expression. v in adcr = int( 256 + 0.5) av ref or av ref av ref (adcr 0.5) v in < (adcr + 0.5) 256 256 remark int ( ): function which returns the integer part of the value in parentheses v in : analog input voltage av ref :av ref pin voltage adcr: a/d conversion result register (adcr) value figure 12-5 shows the relationship between the analog input voltage and the a/d conversion result. figure 12-5. relationship between analog input voltage and a/d conversion result 1 512 1 256 3 512 2 256 5 512 3 256 507 512 254 256 509 512 255 256 511 512 1 0 1 2 3 253 254 255 a/d conversion results (adcr) input voltage/av ref
chapter 12 a/d converter 200 user s manual u11302ej4v0um 12.4.3 a/d converter operating mode select one analog input channel from among ani0 to ani7 using the a/d converter input select register (adis) and a/d converter mode register (adm) and start a/d conversion. a/d conversion can be started in the following two ways. hardware start: conversion is started by trigger input (intp3). software start: conversion is started by setting adm. the a/d conversion result is stored in the a/d conversion result register (adcr) and the interrupt request signal (intad) is simultaneously generated. (1) a/d conversion by hardware start when bit 6 (trg) and bit 7 (cs) of the a/d converter mode register (adm) are set to 1, the a/d conversion standby state is set. when the external trigger signal (intp3) is input, a/d conversion starts on the voltage applied to the analog input pins specified by bits 1 to 3 (adm1 to adm3) of adm. at the end of a/d conversion, the conversion result is stored in the a/d conversion result register (adcr) and the interrupt request signal (intad) is generated. after one a/d conversion operation is started and terminated, another operation is not started until a new external trigger signal is input. if data with cs set to 1 is written to adm again during a/d conversion, the converter suspends its a/d conversion operation and waits for a new external trigger signal to be input. when the external trigger input signal is reinput, a/d conversion is carried out from the beginning. if data with cs set to 0 is written to adm during a/d conversion, the a/d conversion operation stops immediately. figure 12-6. a/d conversion by hardware start remark n = 0, 1, ... , 7 m = 0, 1, ... , 7 anin intad adcr a/d conversion intp3 standby state anin anin standby state anin standby state anim anim anim anin anin anim anim adm rewrite cs = 1, trg = 1 adm rewrite cs = 1, trg = 1
chapter 12 a/d converter 201 user s manual u11302ej4v0um (2) a/d conversion by software start when bit 6 (trg) and bit 7 (cs) of the a/d converter mode register (adm) are set to 0 and 1, respectively, a/d conversion starts on the voltage applied to the analog input pins specified by bits 1 to 3 (adm1 to adm3) of adm. at the end of a/d conversion, the conversion result is stored in the a/d conversion result register (adcr) and the interrupt request signal (intad) is generated. after one a/d conversion operation is started and terminated, the next a/d conversion operation starts immediately. a/d conversion continues repeatedly until new data is written to adm. if data with cs set to 1 is written to adm again during a/d conversion, the converter suspends its a/d conversion operation and starts a/d conversion on the newly written data. if data with cs set to 0 is written to adm during a/d conversion, the a/d conversion operation stops immediately. figure 12-7. a/d conversion by software start remark n = 0, 1, ... , 7 m = 0, 1, ... , 7 anin intad adcr a/d conversion anin anin anim anim anin anim conversion start cs = 1, trg = 0 adm rewrite cs = 1, trg = 0 adm rewrite cs = 0, trg = 0 stop anin conversion suspended conversion results are not stored
chapter 12 a/d converter 202 user s manual u11302ej4v0um 12.5 a/d converter precautions (1) power consumption in standby mode the a/d converter operates on the main system clock. therefore, its operation stops in stop mode or in halt mode with the subsystem clock. as a current still flows in the av ref pin at this time, this current must be cut in order to minimize the overall system power consumption. in this example, the power consumption can be reduced if a low level is output to the output port in the standby mode. however, the actual av ref voltage is not so accurate and, accordingly, the converted value is not accurate and should be used for relative comparison only. figure 12-8. example of method of reducing power consumption in standby mode v dd output port av ref = v dd av ss series resistor string av ref pd780205
chapter 12 a/d converter 203 user s manual u11302ej4v0um (2) input range of ani0 to ani7 the input voltages of ani0 to ani7 should be within the specification range. in particular, if a voltage greater than or equal to av ref or less than or equal to av ss is input (even if within the absolute maximum rating range), the conversion value for that channel will be undefined, and the conversion values of the other channels may also be affected. (3) noise countermeasures in order to maintain 8-bit resolution, attention must be paid to noise on the av ref and ani0 to ani7 pins. since the effect increases in proportion to the output impedance of the analog input source, it is recommended that a capacitor be connected externally as shown in figure 12-9 in order to reduce noise. figure 12-9. analog input pin processing (4) pins ani0/p10 to ani7/p17 the analog input pins ani0 to ani7 also function as i/o port (port 1) pins. pins used as analog inputs should be set to the input mode. when a/d conversion is performed with any of pins ani0 to ani7 selected, be sure not to execute an instruction that inputs data to port 1 while conversion is in progress, as this may reduce the conversion resolution. also, if digital pulses are applied to a pin adjacent to the pin in the process of a/d conversion, the expected a/d conversion value may not be obtainable due to coupling noise. therefore, avoid applying pulses to pins adjacent to the pin undergoing a/d conversion. (5) av ref pin input impedance a series resistor string of approximately 10 k ? is connected between the av ref pin and the av ss pin. therefore, if the output impedance of the reference voltage source is high, this will result in series connection to the series resistor string between the av ref pin and the av ss pin, and there will be a large reference voltage error. reference voltage input av ref ani0 to ani7 v dd av dd av ss v ss c = 100 to 1000 pf if there is possibility that noise whose level is av ref or higher or av ss or lower may enter, clamp with a diode with a small v f (0.3 v or less). av ref
chapter 12 a/d converter 204 user s manual u11302ej4v0um (6) interrupt request flag (adif) the interrupt request flag (adif) is not cleared even if the a/d converter mode register (adm) is changed. therefore, if an analog input pin is changed during a/d conversion, the a/d conversion result for the analog input before changing and adif may be set immediately before rewriting adm. in this case, if adif is read immediately after the rewriting of adm, adif is set despite the fact that a/d conversion of the analog input after changing has not been completed (refer to figure 12-10 ). when a/d conversion is stopped, adif must be cleared before restarting. figure 12-10. a/d conversion end interrupt request generation timing remark n = 0, 1, ... , 7 m = 0, 1, ... , 7 (7) av dd pin the av dd pin is the analog circuit power supply pin, and supplies power to the input circuits of ani0/p10 to ani7/p17. therefore, be sure to apply the voltage at the same level as v dd as shown in figure 12-11 even in an application where the power supply is switched to the back-up power supply. figure 12-11. av dd pin connection adcr intad a/d conversion anin anin anim anim anin anin anim anim adm rewrite (start of anin conversion) adm rewrite (start of anim conversion) adif is set but anim conversion has not ended av ref back up capacitor main power supply v dd av dd v ss av ss
205 user? manual u11302ej4v0um serial transfer mode channel 0 channel 1 3-wire serial i/o clock selection f x /2 2 , f x /2 3 , f x /2 4 , f x /2 5 , f x /2 6 ,f x /2 2 , f x /2 3 , f x /2 4 , f x /2 5 , f x /2 6 , f x /2 7 , f x /2 8 , f x /2 9 , external f x /2 7 , f x /2 8 , f x /2 9 , external clock, to2 output clock, to2 output transfer method msb/lsb switchable as msb/lsb switchable as the start bit the start bit automatic transmit/ receive function transfer end flag serial transfer end interrupt serial transfer end interrupt request flag (csiif0) request flag (csiif1) sbi (serial bus interface) use possible none 2-wire serial i/o chapter 13 serial interface channel 0 the pd780208 subseries incorporates two clocked serial interface channels. the differences between channels 0 and 1 are as follows (refer to chapter 14 serial interface channel 1 for details of serial interface channel 1). table 13-1. differences between channels 0 and 1
chapter 13 serial interface channel 0 206 user? manual u11302ej4v0um 13.1 functions of serial interface channel 0 serial interface channel 0 has the following four modes. table 13-2. modes of serial interface channel 0 operation mode pins used features usage caution do not change the operation mode (3-wire serial i/o, 2-wire serial i/o, or sbi) while the operation of serial interface channel 0 is enabled. stop the serial operation before changing the operation mode. operation stop mode 3-wire serial i/o mode sbi mode 2-wire serial i/o mode sck0 (serial clock), so0 (serial output), si0 (serial input) sck0 (serial clock), sb0 or sb1 (serial data bus) sck0 (serial clock), sb0 or sb1 (serial data bus) used when serial transfer is not carried out. power consumption can be reduced. input and output lines are independent and they can transfer/receive at the same time, so the data transfer processing time is short. the start bit of 8-bit data to undergo serial transfer is switchable between msb and lsb. enables configuration of serial bus with two signal lines, thus, even when connected to some microcontrollers, the number of ports can be cut and the wiring on the board reduced. high-speed serial interface complying with the nec electronics standard bus format. address, command, and data information sent on the serial bus the wakeup function for handshake and acknowledge and busy signal output function can also be used. can cope with any data transfer format by program. thus, the handshake lines previously necessary for connection of two or more devices can be removed. these modes are used for connection of peripheral ics and display controllers that incorporate a clocked serial interface.
chapter 13 serial interface channel 0 207 user? manual u11302ej4v0um 13.2 configuration of serial interface channel 0 serial interface channel 0 consists of the following hardware. table 13-3. configuration of serial interface channel 0 item configuration registers serial i/o shift register 0 (sio0) slave address register (sva) control registers timer clock select register 3 (tcl3) serial operating mode register 0 (csim0) serial bus interface control register (sbic) interrupt timing specification register (sint) port mode register 2 (pm2) note note refer to figure 4-5 block diagram of p20, p21, p23 to p26 and figure 4-6 block diagram of p22 and p27 .
chapter 13 serial interface channel 0 208 user? manual u11302ej4v0um figure 13-1. block diagram of serial interface channel 0 remark output control performs selection between cmos output and n-ch open-drain output. csie0 coi wup csim 04 csim 03 csim 02 csim 01 csim 00 serial operating mode register 0 controller output control selector si0/sb0/p25 pm25 output control so0/sb1/p26 pm26 output control sck0/p27 pm27 selector p25 output latch p26 output latch cld p27 output latch internal bus bsye ackd acke ackt cmdd reld cmdt relt internal bus slave address register (sva) serial i/o shift register 0 (sio0) bus release/ command/ acknowledge detector serial clock counter serial clock controller clr d set q svam match busy/ acknowledge output circuit interrupt request signal generator ackd cmdd reld wup selector selector cld sic svam tcl33tcl32tcl31 tcl30 4 csim01 csim00 csim01 csim00 to2 interrupt timing specification register timer clock select register 3 f x /2 2 to f x /2 9 intcsi0 serial bus interface control register
chapter 13 serial interface channel 0 209 user s manual u11302ej4v0um (1) serial i/o shift register 0 (sio0) this is an 8-bit register used to carry out parallel/serial conversion and serial transmission/reception (shift operations) in synchronization with the serial clock. sio0 is set with an 8-bit memory manipulation instruction. when bit 7 (csie0) of serial operating mode register 0 (csim0) is 1, writing data to sio0 starts serial operation. in transmission, data written to sio0 is output to the serial output (so0) or serial data bus (sb0/sb1). in reception, data is read from the serial input (si0) or sb0/sb1 to sio0. the bus configuration in sbi mode and 2-wire serial i/o mode enables the pin to function as both an input and output pin. thus, when a device is receiving, write ffh to sio0 in advance (except when address reception is carried out by setting bit 5 (wup) of csim0 to 1). in the sbi mode, the busy state can be cleared by writing data to sio0. in this case, bit 7 (bsye) of the serial bus interface control register (sbic) is not cleared to 0. reset input makes sio0 undefined. (2) slave address register (sva) this is an 8-bit register used to set the slave address value for connection of a slave device to the serial bus. this register is not used in the 3-wire serial i/o mode. sva is set with an 8-bit memory manipulation instruction. the master device outputs a slave address to the connected slave devices for selection of a particular slave device. these two data (the slave address output from the master device and the sva value) are compared by the address comparator. if they match, the slave device has been selected. in that case, bit 6 (coi) of serial operating mode register 0 (csim0) becomes 1. address comparison can also be executed on the data of the lsb-masked higher 7 bits by setting bit 4 (svam) of the interrupt timing specification register (sint) to 1. if no matching is detected in address reception, bit 2 (reld) of the serial bus interface control register (sbic) is cleared to 0. the wakeup function can be used by setting bit 5 (wup) of csim0 to 1. in this case, the interrupt request signal (intcsi0) is generated only when the slave address output by the master matches the value of sva, and it can be ascertained by this interrupt request that the master is requesting communication. if bit 5 (sic) of the interrupt timing specification register (sint) is set to 1, the wakeup function cannot be used even if wup is set to 1 (an interrupt request signal is generated when bus release is detected). to use the wakeup function, clear sic to 0. further, an error can be detected by using sva when the device transmits data as a master or slave device in the sbi or 2-wire serial i/o mode. reset input makes sva undefined. (3) so0 latch this latch holds the si0/sb0/p25 and so0/sb1/p26 pin levels. it can be directly controlled by software. in the sbi mode, this latch is set at the end of the 8th serial clock. (4) serial clock counter this counter counts the serial clocks to be output and input during transmission/reception and checks whether 8-bit data has been transmitted/received. (5) serial clock controller this circuit controls serial clock supply to serial i/o shift register 0 (sio0). when the internal system clock is used, the circuit also controls clock output to the sck0/p27 pin.
chapter 13 serial interface channel 0 210 user s manual u11302ej4v0um (6) interrupt request signal generator this circuit controls interrupt request signal generation. it generates an interrupt request signal in the following cases. in the 3-wire serial i/o mode and 2-wire serial i/o mode this circuit generates an interrupt request signal every eight serial clocks. in the sbi mode when wup note is 0 ....... g enerates an interrupt request signal every eight serial clocks. when wup note is 1 ....... g enerates an interrupt request signal when the serial i/o shift register 0 (sio0) value matches the slave address register (sva) value after address reception. note wup is the wakeup function specification bit. it is bit 5 of serial operating mode register 0 (csim0). to use the wakeup function (wup = 1), clear bit 5 (sic) of the interrupt timing specification register (sint) to 0. (7) busy/acknowledge output circuit and bus release/command/acknowledge detector these two circuits output and detect various control signals in the sbi mode. these do not operate in the 3-wire serial i/o mode and 2-wire serial i/o mode. (8) p27 output latch this latch generates a serial clock by software at the end of eight serial clocks. when using serial interface channel 0, set the p27 output latch to 1. reset input sets the latch to 0.
chapter 13 serial interface channel 0 211 user s manual u11302ej4v0um 13.3 control registers of serial interface channel 0 the following four registers are used to control serial interface channel 0. timer clock select register 3 (tcl3) serial operating mode register 0 (csim0) serial bus interface control register (sbic) interrupt timing specification register (sint) (1) timer clock select register 3 (tcl3) (see figure 13-2 .) this register sets the serial clock of serial interface channel 0. tcl3 is set with an 8-bit memory manipulation instruction. reset input sets tcl3 to 88h. remark besides setting the serial clock of serial interface channel 0, tcl3 sets the serial clock of serial interface channel 1. (2) serial operating mode register 0 (csim0) (see figure 13-3 .) this register sets the serial interface channel 0 serial clock, operating mode, operation enable/stop wakeup function and displays the address comparator match signal. csim0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim0 to 00h. caution do not change the operation mode (3-wire serial i/o, 2-wire serial i/o, or sbi) while the operation of serial interface channel 0 is enabled. stop the serial operation before changing the operation mode.
chapter 13 serial interface channel 0 212 user s manual u11302ej4v0um figure 13-2. format of timer clock select register 3 caution if tcl3 is to be rewritten with data other than identical data, stop the serial transfer first. remarks 1. fx: main system clock oscillation frequency 2. figures in parentheses apply to operation with fx = 5.0 mhz. tcl30 tcl3 765432 symbol 10 tcl33 serial interface channel 0 serial clock selection ff43h tcl31 tcl33 tcl32 tcl34 tcl35 tcl36 tcl37 address after reset r/w 88h r/w 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) setting prohibited tcl32 1 1 0 0 0 0 1 1 tcl31 1 1 0 0 1 1 0 0 other than above tcl30 0 1 0 1 0 1 0 1 tcl37 serial interface channel 1 serial clock selection 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) setting prohibited tcl36 1 1 0 0 0 0 1 1 tcl35 1 1 0 0 1 1 0 0 other than above tcl34 0 1 0 1 0 1 0 1
chapter 13 serial interface channel 0 213 user s manual u11302ej4v0um 3-wire serial si0 note 2 so0 i/o mode (input) (cmos output) pm25 p25 pm26 p26 pm27 p27 figure 13-3. format of serial operating mode register 0 r/w csim csim serial interface channel 0 clock selection 01 00 0 x input clock to sck0 pin from off-chip 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 0 to 3 of timer clock select register 3 (tcl3) r/w csim csim csim operating start si0/p25 so0/p26 sck0/p27 04 03 02 mode bit pin function pin function pin function 0 msb sck0 0 1 0001 (cmos i/o) 1 lsb note 3 note 3 sbi mode msb p25 sb1 sck0 0 0001 (cmos i/o) (n-ch open-drain (cmos i/o) i/o) 10 note 3 note 3 sb0 p26 100 0 1 (n-ch open-drain (cmos i/o) i/o) note 3 note 3 2-wire serial msb p25 sb1 sck0 0 0001 i/o mode (cmos i/o) (n-ch open-drain (n-ch open-drain i/o) i/o) 11 note 3 note 3 sb0 p26 100 0 1 (n-ch open-drain (cmos i/o) i/o) r/w wup wakeup function control note 4 0 interrupt request signal generation with each serial transfer in any mode interrupt request signal generation when the address received after bus release (when cmdd = reld = 1) matches the 1 slave address register (sva) in sbi mode r coi slave address comparison result flag note 5 0 slave address register (sva) not equal to serial i/o shift register 0 (sio0) data 1 slave address register (sva) equal to serial i/o shift register 0 (sio0) data r/w csie0 serial interface channel 0 operation control 0 operation stopped 1 operation enabled notes 1. bit 6 (coi) is a read-only bit. 2. can be used as p25 (cmos input) when used only for transmission. 3. can be used freely as port function. 4. to use the wakeup function (wup = 1), clear bit 5 (sic) of the interrupt timing specification register (sint) to 0. 5. coi becomes 0 when csie0 = 0. remark : don t care pm : port mode register p : port output latch csie0 coi wup csim 04 csim 03 csim 02 csim 01 csim 00 <7><6><5>43210 csim0 symbol ff60h 00h r/w note 1 address after reset r/w
chapter 13 serial interface channel 0 214 user? manual u11302ej4v0um (3) serial bus interface control register (sbic) this register sets the serial bus interface operation and displays statuses. sbic is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sbic to 00h. figure 13-4. format of serial bus interface control register (1/2) r/w relt used for bus release signal output. when relt = 1, the so latch is set to 1. after so latch setting, relt is automatically cleared to 0. also cleared to 0 when csie0 = 0. r/w cmdt used for command signal output. when cmdt = 1, the so latch is cleared to 0. after so latch clearance, cmdt is automatically cleared to 0. also cleared to 0 when csie0 = 0. r reld bus release detection clear conditions (reld = 0) set conditions (reld = 1) when transfer start instruction is executed when bus release signal (rel) is detected if sio0 and sva values do not match in address reception when csie0 = 0 when reset input is applied r cmdd command detection clear conditions (cmdd = 0) set conditions (cmdd = 1) when transfer start instruction is executed when command signal (cmd) is detected when bus release signal (rel) is detected when csie0 = 0 when reset input is applied r/w ackt the acknowledge signal is output in synchronization with the falling edge clock of sck0 just after execution of the instruction to be set to 1, and after acknowledge signal output, ackt is automatically cleared to 0. also cleared to 0 upon start of serial interface transfer or when csie0 = 0. note bits 2, 3, and 6 (reld, cmdd, and ackd) are read-only bits. remark csie0: bit 7 of serial operating mode register 0 (csim0) <6> <5> <4> <3> <2> <1> <0> <7> symbol sbic bsye ackd acke ackt cmdd reld cmdt relt ff61h 00h r/w note address after reset r/w
chapter 13 serial interface channel 0 215 user? manual u11302ej4v0um figure 13-4. format of serial bus interface control register (2/2) r/w acke acknowledge signal output control 0 acknowledge signal automatic output disabled (output with ackt enabled) before completion the acknowledge signal is output in synchronization with the 9th clock of transfer falling edge of sck0 (automatically output when acke = 1). 1 after completion the acknowledge signal is output in synchronization with the falling edge of of transfer sck0 just after execution of the instruction to be set to 1 (automatically output when acke = 1). however, acke is not automatically cleared to 0 after acknowledge signal output. r ackd acknowledge detection clear conditions (ackd = 0) set conditions (ackd = 1) at the falling edge of sck0 immediately after the when acknowledge signal (ack) is detected at the busy mode has been released when a transfer rising edge of sck0 clock after completion of start instruction is executed transfer when csie0 = 0 when reset input is applied r/w bsye note synchronizing busy signal output control busy signal which is output in synchronization with the falling edge of sck0 clock just after 0 execution of the instruction to be cleared to 0 is disabled. 1 busy signal is output at the falling edge of sck0 clock following the acknowledge signal. note busy mode can be cleared by start of serial interface transfer. however, the bsye flag is not cleared to 0. remarks 1. bits 0, 1, and 4 (relt, cmdt, and ackt) are 0 when read after data setting. 2. csie0: bit 7 of serial operating mode register 0 (csim0)
chapter 13 serial interface channel 0 216 user s manual u11302ej4v0um (4) interrupt timing specification register (sint) this register sets the bus release interrupt and address mask functions and displays the sck0 pin level status. sint is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sint to 00h. figure 13-5. format of interrupt timing specification register notes 1. bit 6 (cld) is a read-only bit. 2. when using wakeup function, set sic to 0. 3. when csie0 = 0, cld becomes 0. caution be sure to set bits 0 to 3 to 0. remark sva: slave address register csiif0: interrupt request flag for intcsi0 csie0: bit 7 of serial operating mode register 0 (csim0) <6><5><4>3210 7 symbol sint 0 cld sic svam 0 0 0 0 ff63h 00h r/w note 1 address after reset r/w svam 0 1 sva bit to be used as slave address bits 0 to 7 bits 1 to 7 sic 0 1 intcsi0 interrupt source selection note 2 csiif0 is set upon termination of serial interface channel 0 transfer csiif0 is set upon bus release detection or termination of serial interface channel 0 transfer cld 0 1 sck0 pin level note 3 low level high level r/w r/w r
chapter 13 serial interface channel 0 217 user s manual u11302ej4v0um 13.4 operations of serial interface channel 0 the following four operating modes are available for serial interface channel 0. operation stop mode 3-wire serial i/o mode sbi mode 2-wire serial i/o mode 13.4.1 operation stop mode serial transfer is not carried out in the operation stop mode. thus, power consumption can be reduced. serial i/o shift register 0 (sio0) does not carry out shift operations and can be used as an ordinary 8-bit register. in the operation stop mode, the p25/si0/sb0, p26/so0/sb1, and p27/sck0 pins can be used as ordinary i/o ports. (1) register setting the operation stop mode is set by serial operating mode register 0 (csim0). csim0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim0 to 00h. r/w csie0 serial interface channel 0 operation control 0 operation stopped 1 operation enabled <6><5>43210 <7> symbol csim0 csie0 coi wup csim04 csim03 csim02 csim01 csim00 ff60h 00h r/w address after reset r/w
chapter 13 serial interface channel 0 218 user s manual u11302ej4v0um 13.4.2 3-wire serial i/o mode operation the 3-wire serial i/o mode is used for connection of peripheral ics and display controllers that incorporate a clocked serial interface. communication is carried out using three lines: a serial clock (sck0), serial output (so0), and serial input (si0). (1) register setting the 3-wire serial i/o mode is set by serial operating mode register 0 (csim0) and serial bus interface control register (sbic). (a) serial operating mode register 0 (csim0) csim0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim0 to 00h.
chapter 13 serial interface channel 0 219 user s manual u11302ej4v0um pm25 p25 pm26 p26 pm27 p27 r/w csim csim serial interface channel 0 clock selection 01 00 0 input clock to sck0 pin from off-chip 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 0 to 3 of timer clock select register 3 (tcl3) r/w csim csim csim operating start si0/p25 so0/p26 sck0/p27 04 03 02 mode bit pin function pin function pin function 0 msb 0 1 0001 1 lsb 1 0 sbi mode (refer to 13.4.3 sbi mode operation ) 1 1 2-wire serial i/o mode (refer to 13.4.4 2-wire serial i/o mode operation ) r/w wup wakeup function control note 3 0 interrupt request signal generation with each serial transfer in any mode interrupt request signal generation when the address received after bus release (when cmdd = reld = 1) matches the 1 slave address register (sva) in sbi mode r coi slave address comparison result flag note 4 0 slave address register (sva) not equal to serial i/o shift register 0 (sio0) data 1 slave address register (sva) equal to serial i/o shift register 0 (sio0) data r/w csie0 serial interface channel 0 operation control 0 operation stopped 1 operation enabled notes 1. bit 6 (coi) is a read-only bit. 2. can be used as p25 (cmos input) when used only for transmission. 3. set wup to 0 when the 3-wire serial i/o mode is selected. 4. when csie0 = 0, coi becomes 0. remark : don t care pm : port mode register p : port output latch 3-wire serial si0 note 2 so0 sck0 i/o mode (input) (cmos output) (cmos i/o) csie0 coi wup csim 04 csim 03 csim 02 csim 01 csim 00 <7><6><5>43210 csim0 symbol ff60h 00h r/w note 1 address after reset r/w
chapter 13 serial interface channel 0 220 user s manual u11302ej4v0um (b) serial bus interface control register (sbic) sbic is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sbic to 00h. r/w when relt = 1, the so latch is set to 1. after so latch setting, relt is automatically cleared to 0. relt also cleared to 0 when csie0 = 0. r/w when cmdt = 1, the so latch is cleared to 0. after so latch clearance, cmdt is automatically cleared to 0. cmdt also cleared to 0 when csie0 = 0. csie0: bit 7 of serial operating mode register 0 (csim0) <6> <5> <4> <3> <2> <1> <0> <7> symbol sbic bsye ackd acke ackt cmdd reld cmdt relt ff61h 00h r/w address after reset r/w
chapter 13 serial interface channel 0 221 user s manual u11302ej4v0um (2) communication operation the 3-wire serial i/o mode is used for data transmission/reception in 8-bit units. data transmission/ reception is carried out bit by bit in synchronization with the serial clock. shift operations of serial i/o shift register 0 (sio0) are carried out at the falling edge of the serial clock (sck0). the transmit data is held in the so0 latch and is output from the so0 pin. the receive data input to the si0 pin is latched into sio0 at the rising edge of sck0. upon termination of 8-bit transfer, sio0 operation stops automatically and the interrupt request flag (csiif0) is set. figure 13-6. 3-wire serial i/o mode timing the so0 pin is used for cmos output and generates the so0 latch status. thus, the so0 pin output status can be manipulated by setting bit 0 (relt) and bit 1 (cmdt) of the serial bus interface control register (sbic). however, do not carry out this manipulation during serial transfer. control the sck0 pin output level in the output mode (internal system clock mode) by manipulating the p27 output latch (refer to 13.4.5 sck0/p27 pin output manipulation ). si0 sck0 12345678 di7 di6 di5 di4 di3 di2 di1 di0 so0 do7 do6 do5 do4 do3 do2 do1 do0 csiif0 transfer start at falling edge of sck0 end of transfer
chapter 13 serial interface channel 0 222 user s manual u11302ej4v0um (3) signals figure 13-7 shows the relt and cmdt operations. figure 13-7. relt and cmdt operations (4) msb/lsb switching as the start bit in the 3-wire serial i/o mode, transfer can be selected to start from the msb or lsb. figure 13-8 shows the configuration of serial i/o shift register 0 (sio0) and the internal bus. as shown in the figure, the msb/lsb can be read/written in reverse form. msb/lsb switching as the start bit can be specified using bit 2 (csim02) of serial operating mode register 0 (csim0). figure 13-8. circuit for switching transfer bit order start bit switching is realized by switching the bit order for data write to sio0. the sio0 shift order remains unchanged. thus, switch the msb/lsb start bit before writing data to the shift register. relt cmdt so0 latch 7 6 internal bus 1 0 lsb start msb start read/write gate si0 shift register 0 (sio0) read/write gate so0 sck0 dq so0 latch
chapter 13 serial interface channel 0 223 user s manual u11302ej4v0um (5) transfer start serial transfer is started by setting transfer data to serial i/o shift register 0 (sio0) when the following two conditions are satisfied. serial interface channel 0 operation control bit (csie0) = 1 internal serial clock is stopped or sck0 is at high level after 8-bit serial transfer. caution if csie0 is set to ??after data write to sio0, transfer does not start. upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (csiif0) is set. 13.4.3 sbi mode operation sbi (serial bus interface) is a high-speed serial interface that complies with the nec electronics serial bus format. sbi is a single-master high-speed serial bus with a format in which a bus configuration function has been added to the clocked serial i/o method so that it can carry out communication with two or more devices using two signal lines. thus, when configuring a serial bus with two or more microcontrollers or peripheral ics, the number of ports to be used and the number of wires on the board can be decreased. the master device can output to the serial data bus of the slave device addresses for selection of the serial communication target device, commands to instruct the target device and actual data . the slave device can identify the received data as an address , command , or data , by hardware. this function can simplify the application program which controls serial interface channel 0. the sbi function is incorporated into various devices including the 75xl series and 78k series. figure 13-9 shows a serial bus configuration example when a cpu having a serial interface compliant with sbi and peripheral ics are used. in sbi, the sb0 (sb1) serial data bus pin is an open-drain output and so the serial data bus line is in a wired- or state. a pull-up resistor is therefore necessary for the serial data bus line. refer to (11) sbi mode precautions (d) described later when the sbi mode is used.
chapter 13 serial interface channel 0 224 user s manual u11302ej4v0um figure 13-9. example of serial bus configuration with sbi caution when replacing the master cpu/slave cpu, a pull-up resistor is necessary for the serial clock line (sck0) as well because serial clock line (sck0) input/output switching is carried out asynchronously between the master and slave cpus. master cpu sck0 sb0 (sb1) sck0 sb0 (sb1) sck0 sb0 (sb1) sck0 sb0 (sb1) slave cpu address 1 slave cpu address 2 slave ic address n serial clock serial data bus v dd
chapter 13 serial interface channel 0 225 user s manual u11302ej4v0um (1) sbi functions with the conventional serial i/o method, when a serial bus is configured by connecting two or more devices, many ports and wiring are necessary to distinguish chip select signals and command/data and to judge the busy state because only a data transfer function is available. controlling these operations by software places a heavy load on the software. in sbi, a serial bus can be configured with two signal lines: a serial clock sck0 and serial data bus sb0 (sb1). thus, sbi is effective to decrease the number of microcontroller ports and wiring and routing on the board. the sbi functions are described below. (a) address/command/data identification function serial data is distinguished into addresses, commands, and data. (b) chip select function by address transmission the master executes slave chip selection by address transmission. (c) wakeup function the slave can easily judge address reception (chip select judgment) using the wakeup function (which can be set/reset by software). when the wakeup function is set, the interrupt request signal (csiif0) is generated upon reception of a match address. thus, when communication is executed with two or more devices, the cpus of other than the selected slave device can operate irrespective of serial communication. (d) acknowledge signal (ack) control function the acknowledge signal to check serial data reception is controlled. (e) busy signal (busy) control function the busy signal to report the slave busy state is controlled.
chapter 13 serial interface channel 0 226 user s manual u11302ej4v0um (2) sbi definition the sbi serial data format is defined as follows. serial data to be transferred with sbi is distinguished into three types, address , command , and data . figure 13-10 shows the address, command, and data transfer timing. figure 13-10. sbi transfer timing remark the broken line indicates the ready status. the bus release signal and the command signal are output by the master device. busy is output by the slave. ack can be output by either the master or slave device (normally, the 8-bit data receiver outputs ack). serial clocks continue to be output by the master device from 8-bit data transfer start to busy reset. sck0 sb0/sb1 sck0 sb0/sb1 sck0 sb0/sb1 89 9 a7 address a0 ack busy c7 c0 ack busy ready 89 d7 d0 ack busy ready address transfer command transfer data transfer command signal bus release signal command data
chapter 13 serial interface channel 0 227 user s manual u11302ej4v0um (a) bus release signal (rel) the bus release signal is identified when the sb0 (sb1) line has changed from low level to high level while the sck0 line is high level (without serial clock output). this signal is output by the master device. figure 13-11. bus release signal the bus release signal indicates that the master device is going to transmit an address to the slave device. the slave device incorporates hardware to detect the bus release signal. caution if the sb0 (sb1) line changes from low level to high level while the sck0 line is high level, it is recognized as a bus release signal. therefore, if the changing timing of the bus fluctuates because of substrate capacitance, etc., it may be recognized as a bus release signal even while data is being transmitted. care should therefore be taken in the wiring. (b) command signal (cmd) the command signal is identified when the sb0 (sb1) line has changed from high level to low level while the sck0 line is high level (without serial clock output). this signal is output by the master device. figure 13-12. command signal the command signal indicates that from this point, the master will send a command to the slave (however, command signals following bus release signals indicate that an address will be sent). the slave incorporates hardware to detect command signals. caution if the sb0 (sb1) line changes from high level to low level while the sck0 line is high level, it is recognized as a command signal. therefore, if the changing timing of the bus fluctuates because of substrate capacitance, etc., it may be recognized as a command signal even while data is being transmitted. care should therefore be taken in the wiring. sck0 "h" sb0 (sb1) sck0 "h" sb0 (sb1)
chapter 13 serial interface channel 0 228 user s manual u11302ej4v0um (c) address an address is 8-bit data which the master device outputs to the slave device connected to the bus line in order to select a particular slave device. figure 13-13. address 8-bit data following bus release and command signals is defined as an address . in the slave device, this condition is detected by hardware and whether or not the 8-bit data matches the slave s own specification number (slave address) is checked by hardware. if the 8-bit data matches the slave address, the slave device has been selected. after that, communication with the master device continues until a release instruction is received from the master device. figure 13-14. slave selection by address master slave 1 not selected slave 2 selected slave 3 not selected slave 4 not selected slave 2 address transmission sck0 a7 a6 a5 a4 a3 a2 a1 a0 12345678 sb0 (sb1) address command signal bus release signal
chapter 13 serial interface channel 0 229 user s manual u11302ej4v0um (d) command and data the master device transmits commands to, and transmits/receives data to/from the slave device selected by address transmission. figure 13-15. commands figure 13-16. data 8-bit data following a command signal is defined as command data. 8-bit data without a command signal is defined as data . command and data operation procedures can be determined by the user according to their communication specifications. sck0 d7 d6 d5 d4 d3 d2 d1 d0 12345678 sb0 (sb1) data sck0 c7 c6 c5 c4 c3 c2 c1 c0 12345678 sb0 (sb1) command command signal
chapter 13 serial interface channel 0 230 user s manual u11302ej4v0um (e) acknowledge signal (ack) the acknowledge signal is used to check serial data reception between the transmitter and receiver. figure 13-17. acknowledge signal [when output in synchronization with 11th clock of sck0] [when output in synchronization with 9th clock of sck0] remark the broken line indicates the ready status. the acknowledge signal is a one-shot pulse generated at the falling edge of sck0 after 8-bit data transfer. it can be positioned anywhere and can be synchronized with any clock of sck0. after 8-bit data transmission, the transmitter checks whether the receiver has returned the acknowledge signal. if the acknowledge signal is not returned for the preset period of time after data transmission, it can be judged that data reception has not been carried out correctly. 89 ack sck0 sb0 (sb1) sck0 sb0 (sb1) 8 9 10 11 ack
chapter 13 serial interface channel 0 231 user s manual u11302ej4v0um (f) busy signal (busy) and ready signal (ready) the busy signal is used to report to the master device that the slave device is not ready for data transmission/reception. the ready signal is used to report to the master device that the slave device is ready for data transmission/reception. figure 13-18. busy and ready signals in sbi, the slave device notifies the master device of the busy state by setting the sb0 (sb1) line to low level. busy signal output follows acknowledge signal output from the master or slave device. it is set/reset at the falling edge of sck0. when the busy signal is reset, the master device automatically terminates the output of the sck0 serial clock. when the busy signal is reset and the ready signal is set, the master device can start the next transfer. caution in sbi, after specifying reset of busy, the busy signal is output until the fall of the next serial clock (sck0). if wup = 1 is set during this interval by mistake, it will be impossible to reset busy. therefore, after busy is released, make sure that the sb0 (sb1) pin is high level before setting wup = 1. (3) register setting the sbi mode is set by serial operating mode register 0 (csim0), the serial bus interface control register (sbic), and the interrupt timing specification register (sint). ready ack sck0 sb0 (sb1) busy 89
chapter 13 serial interface channel 0 232 user s manual u11302ej4v0um pm25 p25 pm26 p26 pm27 p27 (a) serial operating mode register 0 (csim0) csim0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim0 to 00h. r/w csim csim serial interface channel 0 clock selection 01 00 0 input clock to sck0 pin from off-chip 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 0 to 3 of timer clock select register 3 (tcl3) r/w csim csim csim operating start si0/p25 so0/p26 sck0/p27 04 03 02 mode bit pin function pin function pin function 0 3-wire serial i/o mode (refer to 13.4.2 3-wire serial i/o mode operation ) note 2 note 2 sbi mode msb p25 sb1 sck0 0 0001 (cmos i/o) (n-ch open-drain (cmos i/o) i/o) 10 note 2 note 2 sb0 p26 100 0 1 (n-ch open-drain (cmos i/o) i/o) 1 1 2-wire serial i/o mode (refer to 13.4.4 2-wire serial i/o mode operation ) r/w wup wakeup function control note 3 0 interrupt request signal generation with each serial transfer in any mode interrupt request signal generation when the address received after bus release (when cmdd = reld = 1) matches the 1 slave address register (sva) in sbi mode r coi slave address comparison result flag note 4 0 slave address register (sva) not equal to serial i/o shift register 0 (sio0) data 1 slave address register (sva) equal to serial i/o shift register 0 (sio0) data r/w csie0 serial interface channel 0 operation control 0 operation stopped 1 operation enabled notes 1. bit 6 (coi) is a read-only bit. 2. can be used freely as port function. 3. to use the wakeup function (wup = 1), clear bit 5 (sic) of the interrupt timing specification register (sint) to 0. 4. when csie0 = 0, coi becomes 0. remark : don t care pm : port mode register p : port output latch csie0 coi wup csim 04 csim 03 csim 02 csim 01 csim 00 <7><6><5>43210 csim0 symbol ff60h 00h r/w note 1 address after reset r/w
chapter 13 serial interface channel 0 233 user s manual u11302ej4v0um (b) serial bus interface control register (sbic) sbic is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sbic to 00h. r/w relt used for bus release signal output. when relt = 1, the so latch is set to 1. after so latch setting, relt is automatically cleared to 0. also cleared to 0 when csie0 = 0. r/w cmdt used for command signal output. when cmdt = 1, the so latch is cleared to 0. after so latch clearance, cmdt is automatically cleared to 0. also cleared to 0 when csie0 = 0. r reld bus release detection clear conditions (reld = 0) set conditions (reld = 1) when transfer start instruction is executed when bus release signal (rel) is detected if sio0 and sva values do not match in address reception when csie0 = 0 when reset input is applied r cmdd command detection clear conditions (cmdd = 0) set conditions (cmdd = 1) when transfer start instruction is executed when command signal (cmd) is detected when bus release signal (rel) is detected when csie0 = 0 when reset input is applied r/w ackt the acknowledge signal is output in synchronization with the falling edge clock of sck0 just after execution of the instruction to be set to 1, and after acknowledge signal output, ackt is automatically cleared to 0. used as acke = 0. also cleared to 0 upon start of serial interface transfer or when csie0 = 0. (continued) note bits 2, 3, and 6 (reld, cmdd, and ackd) are read-only bits. remarks 1. bits 0, 1, and 4 (relt, cmdt, and ackt) are 0 when read after data setting. 2. csie0: bit 7 of serial operating mode register 0 (csim0) <6> <5> <4> <3> <2> <1> <0> <7> symbol sbic bsye ackd acke ackt cmdd reld cmdt relt ff61h 00h r/w note address after reset r/w
chapter 13 serial interface channel 0 234 user s manual u11302ej4v0um (continued) r/w acke acknowledge signal output control 0 acknowledge signal automatic output disabled (output with ackt enabled) before completion the acknowledge signal is output in synchronization with the 9th clock of transfer falling edge of sck0 (automatically output when acke = 1). 1 after completion the acknowledge signal is output in synchronization with the falling edge of sck0 of transfer just after execution of the instruction to be set to 1 (automatically output when acke = 1). however, acke is not automatically cleared to 0 after acknowledge signal output. r ackd acknowledge detection clear conditions (ackd = 0) set conditions (ackd = 1) at the falling edge of sck0 immediately after the when acknowledge signal (ack) is detected at the busy mode has been released when a transfer start rising edge of sck0 clock after completion of instruction is executed transfer when csie0 = 0 when reset input is applied r/w bsye note synchronizing busy signal output control busy signal which is output in synchronization with the falling edge of sck0 clock just after 0 execution of the instruction to be cleared to 0 (sets ready state) is disabled. 1 busy signal is output at the falling edge of sck0 clock following the acknowledge signal. note busy mode can be cleared by start of serial interface transfer. however, the bsye flag is not cleared to 0. remark csie0: bit 7 of serial operating mode register 0 (csim0)
chapter 13 serial interface channel 0 235 user s manual u11302ej4v0um (c) interrupt timing specification register (sint) sint is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sint to 00h. notes 1. bit 6 (cld) is a read-only bit. 2. when using the wakeup function in the sbi mode, set sic to 0. 3. when csie0 = 0, cld becomes 0. caution be sure to set bits 0 to 3 to 0. remark sva: slave address register csiif0: interrupt request flag for intcsi0 csie0: bit 7 of serial operating mode register 0 (csim0) <6><5><4>3210 7 symbol sint 0 cld sic svam 0 0 0 0 ff63h 00h r/w note 1 address after reset r/w svam 0 1 sva bit to be used as slave address bits 0 to 7 bits 1 to 7 sic 0 1 intcsi0 interrupt source selection note 2 csiif0 is set upon termination of serial interface channel 0 transfer csiif0 is set upon bus release detection or termination of serial interface channel 0 transfer cld 0 1 sck0 pin level note 3 low level high level r/w r/w r
chapter 13 serial interface channel 0 236 user s manual u11302ej4v0um (4) signals figures 13-19 to 13-24 show the signals and operations of the flags of the serial bus interface control register (sbic) in sbi. table 13-4 lists the signals in sbi. figure 13-19. relt, cmdt, reld, and cmdd operations (master) figure 13-20. reld and cmdd operations (slave) sck0 sb0 (sb1) relt cmdt cmdd reld sio0 slave address write to sio0 (transfer start instruction) sio0 sck0 so0 latch reld cmdd 1 2 7 8 a7 a6 a1 a0 write ffh to sio0 (transfer start instruction) transfer start instruction when addresses match a7 a6 a1 a0 9 ready ack slave address when addresses do not match
chapter 13 serial interface channel 0 237 user s manual u11302ej4v0um figure 13-21. ackt operation caution do not set ackt before termination of transfer. sck0 6 sb0/sb1 ackt 7 8 9 d2 d1 d0 ack when set during this period ack signal is output for a period of one clock just after setting
chapter 13 serial interface channel 0 238 user s manual u11302ej4v0um figure 13-22. acke operations (a) when acke = 1 upon completion of transfer (d) when acke = 1 period is short (c) when acke = 0 upon completion of transfer (b) when set after completion of transfer sck0 sb0/sb1 acke if set and cleared during this period and acke = 0 at the falling edge of sck0 ack signal is not output d2 d1 d0 sck0 sb0/sb1 acke 1 2 789 d7 d6 d2 d1 d0 when acke = 0 at this point ack signal is not output sck0 sb0/sb1 acke 7 89 d1 d0 ack 6 d2 if set during this period and acke = 1 at the falling edge of the next sck0 ack signal is output for a period of one clock just after setting sck0 sb0/sb1 acke 1 2 789 d7 d6 d2 d1 d0 ack when acke = 1 at this point ack signal is output at 9th clock
chapter 13 serial interface channel 0 239 user s manual u11302ej4v0um figure 13-23. ackd operations (a) when ack signal is output at 9th clock of sck0 (b) when ack signal is output after 9th clock of sck0 (c) clear timing when transfer start is instructed during busy figure 13-24. bsye operation sck0 sb0/sb1 bsye 7 89 ack 6 when bsye = 1 at this point busy if reset during this period and bsye = 0 at the falling edge of sck0 d2 d1 d0 sck0 sb0/sb1 ackd 789 d1 d0 ack 6 d2 transfer start instruction sio0 transfer start sck0 sb0/sb1 ackd ack 9 sio0 78 d1 6 d2 d0 transfer start instruction transfer start sck0 sb0/sb1 ackd 9 transfer start instruction sio0 78 d1 6 d2 d0 d6 d7 busy ack
chapter 13 serial interface channel 0 240 user s manual u11302ej4v0um table 13-4. signals in sbi mode (1/2) bus release signal (rel) command signal (cmd) master master sb0/sb1 rising edge when sck0 = 1 sb0/sb1 falling edge when sck0 = 1 relt set cmdt set reld set cmdd clear cmdd set [synchronous busy signal] low-level signal output to sb0/sb1 following acknowledge signal low-level signal output to sb0/sb1 during one-clock period of sck0 after completion of serial reception master/ slave acknowledge signal (ack) slave busy signal (busy) bsye = 1 [1] acke = 1 [2] ackt set ackd set cmd signal is output to indicate that transmit data is an address. completion of reception serial receive disabled because of processing serial receive enabled i) transmit data is an address after rel signal output. ii) rel si gnal is not output and transmit data is a command. signal name output device definition high-level signal output to sb0/sb1 before serial transfer start and after completion of serial transfer slave ready signal (ready) timing chart output condition effect on flag meaning of signal [synchronous busy output] d0 ready sb0/sb1 d0 ready sb0/sb1 sck0 ack busy busy ack 9 [1] bsye = 0 [2] execution of instruction data write to sio0 (transfer start instruction) sck0 h sb0/sb1 sck0 h sb0/sb1
chapter 13 serial interface channel 0 241 user s manual u11302ej4v0um csiif0 set (rising edge of 9th clock of sck0) note 1 signal name output device definition timing chart output condition effect on flag meaning of signal table 13-4. signals in sbi mode (2/2) master/ slave master master master data (d7 to d0) command (c7 to c0) address (a7 to a0) serial clock (sck0) 8-bit data transferred in synchronization with sck0 after output of only cmd signal without rel signal output 8-bit data transferred in synchronization with sck0 without output of rel and cmd signals 8-bit data transferred in synchronization with sck0 after output of rel and cmd signals when csie0 = 1, execution of instruction for data write to sio0 (serial transfer start instruction) note 2 timing of signal output to serial data bus address value of slave device on the serial bus instructions and messages to the slave device numeric values to be processed with slave or master device synchronous clock to output address/command/data, ack signal, synchronous busy signal, etc. address/command/data are transferred with the first eight synchronous clocks. sck0 sb0/sb1 1278910 sck0 sb0/sb1 1278 rel cmd sck0 sb0/sb1 1278 cmd sck0 sb0/sb1 1278 notes 1. when wup = 0, csiif0 is always set at the rising edge of the 9th clock of sck0. when wup = 1, csiif0 is set only when the received address matches the slave address register (sva) value. 2. in the busy state, transfer starts after the ready state is entered.
chapter 13 serial interface channel 0 242 user s manual u11302ej4v0um (5) pin configuration the serial clock pin sck0 and serial data bus pin sb0 (sb1) have the following configurations. (a) sck0: serial clock i/o pin [1] master: cmos and push-pull output [2] slave: schmitt input (b) sb0 (sb1): serial data i/o alternate-function pin both master and slave devices have an n-ch open-drain output and a schmitt input. because the serial data bus line has an n-ch open-drain output, an external pull-up resistor is necessary. figure 13-25. pin configuration caution because the n-ch open-drain output must be high impedance at the time of data reception, write ffh to serial i/o shift register 0 (sio0) in advance. the n-ch open- drain output can be high impedance throughout transfer. however, when the wakeup function specification bit (wup) = 1, the n-ch open-drain output is always high impedance. thus, it is not necessary to write ffh to sio0. si0 so0 si0 so0 (clock input) clock output master device clock input (clock output) serial clock sck0 sck0 r l serial data bus sb0 (sb1) sb0 (sb1) n-ch open-drain n-ch open-drain slave device v dd
chapter 13 serial interface channel 0 243 user s manual u11302ej4v0um (6) address match detection method in the sbi mode, the master transmits a slave address to select a specific slave device. a match of the addresses can be automatically detected by hardware. csiif0 is set only when the slave address transmitted by the master matches the address set to sva when the wakeup function specification bit (wup) = 1. if bit 5 (sic) of the interrupt timing specification register (sint) is set to 1, the wakeup function cannot be used even if wup is set to 1 (an interrupt request signal is generated when bus release is detected). to use the wakeup function, clear sic to 0. cautions 1. slave selection/non-selection is detected by matching of the slave address received after bus release (reld = 1). for this match detection, the match interrupt request (csiif0) of the address to be generated with wup = 1 is normally used. thus, execute selection/non-selection detection by slave address when wup = 1. 2. when detecting selection/non-selection without the use of an interrupt request with wup = 0, do so by means of transmission/reception of the command preset by program instead of using the address match detection method. (7) error detection in the sbi mode, the serial bus sb0 (sb1) status being transmitted is fetched into the destination device, that is, serial i/o shift register 0 (sio0). thus, transmit errors can be detected in the following two ways. (a) comparison of sio0 data before transmission to that after transmission in this case, if the two data differ, a transmit error is judged to have occurred. (b) use of the slave address register (sva) transmit data is set to both sio0 and sva and is transmitted. after termination of transmission, the coi bit (match signal coming from the address comparator) of serial operating mode register 0 (csim0) is tested. if 1 , normal transmission is judged to have been carried out. if 0 , a transmit error is judged to have occurred. (8) communication operation in the sbi mode, the master device normally selects one slave device as the communication target from among two or more devices by outputting an address to the serial bus. after the communication target device has been determined, commands and data are transmitted/ received and serial communication is realized between the master and slave devices. figures 13-26 to 13-29 show data communication timing charts. shift operations of serial i/o shift register 0 (sio0) are carried out at the falling edge of the serial clock (sck0). transmit data is latched into the so0 latch and is output with the msb set as the start bit from the sb0/p25 or sb1/p26 pin. receive data input to the sb0 (or sb1) pin at the rising edge of sck0 is latched into sio0.
chapter 13 serial interface channel 0 244 user s manual u11302ej4v0um figure 13-26. address transmission from master device to slave device (wup = 1) 1 2 3 4 5 6 7 8 9 sck0 pin a7 a6 a5 a4 a3 a2 a1 a0 ack busy sb0 pin program processing serial transmission intcsi0 generation ackd set sck0 stop hardware operation wup 0 ackt set program processing cmdd set intcsi0 generation ack output hardware operation cmdt set relt set cmdt set write to sio0 interrupt servicing (preparation for the next serial transfer) master device processing (transmitter) transfer line slave device processing (receiver) cmdd clear cmdd set reld set serial reception busy output ready (when sva = sio0) address busy clear busy clear
chapter 13 serial interface channel 0 245 user s manual u11302ej4v0um figure 13-27. command transmission from master device to slave device 1 2 3 4 5 6 7 8 9 sck0 pin c7 c6 c5 c4 c3 c2 c1 c0 ack busy sb0 pin program processing serial transmission intcsi0 generation ackd set sck0 stop hardware operation ackt set program processing intcsi0 generation ack output hardware operation cmdt set write to sio0 interrupt servicing (preparation for the next serial transfer) master device processing (transmitter) transfer line slave device processing (receiver) cmdd set serial reception busy output ready command busy clear busy clear sio0 read command analysis
chapter 13 serial interface channel 0 246 user s manual u11302ej4v0um figure 13-28. data transmission from master device to slave device 1 2 3 4 5 6 7 8 9 sck0 pin d7 d6 d5 d4 d3 d2 d1 d0 ack busy sb0 pin program processing serial transmission intcsi0 generation ackd set sck0 stop hardware operation ackt set program processing intcsi0 generation ack output hardware operation write to sio0 interrupt servicing (peparation for the next serial transfer) master device processing (transmitter) transfer line slave device processing (receiver) serial reception busy output ready data busy clear busy clear sio0 read
chapter 13 serial interface channel 0 247 user s manual u11302ej4v0um figure 13-29. data transmission from slave device to master device 1 2 3 4 5 6 7 8 9 sck0 pin d7 d6 d5 d4 d3 d2 d1 d0 ack busy sb0 pin program processing serial reception intcsi0 generation ack output serial reception hardware operation program processing intcsi0 generation ackd set hardware operation ffh write to sio0 master device processing (receiver) transfer line slave device processing (transmitter) serial transmission busy output ready data busy clear write to sio0 sck0 stop busy clear 12 ready busy d7 d6 ackt set sio0 read receive data processing ffh write to sio0 write to sio0
chapter 13 serial interface channel 0 248 user s manual u11302ej4v0um (9) transfer start serial transfer is started by setting transfer data to serial i/o shift register 0 (sio0) when the following two conditions are satisfied. serial interface channel 0 operation control bit (csie0) = 1 internal serial clock is stopped or sck0 is at high level after 8-bit serial transfer. cautions 1. if csie0 is set to 1 after data write to sio0, transfer does not start. 2. because the n-ch open-drain output must be made to go into a high-impedance state during data reception, write ffh to sio0 in advance. however, when the wakeup function specification bit (wup) = 1, the n-ch open-drain output always goes into a high-impedance state. thus, it is not necessary to write ffh to sio0. 3. if data is written to sio0 when the slave is busy, the data is not lost. when the busy state is cleared and sb0 (or sb1) input is set to the high level (ready) state, transfer starts. upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (csiif0) is set. for the pin that is to be used for data i/o (sb0 or sb1), be sure to set as follows before serial transfer of the 1st byte after reset input. [1] set the p25 and p26 output latches to 1. [2] set bit 0 (relt) of the serial bus interface control register (sbic) to 1. [3] reset the p25 and p26 output latches from 1 to 0. (10)judging busy status of slave when the device is in the master mode, follow the procedure below to judge whether the slave device is in the busy state or not. [1] detect acknowledge signal (ack) or interrupt request signal generation. [2] set the port mode register pm25 (or pm26) of the sb0/p25 (or sb1/p26) pin to the input mode. [3] read out the pin state (when the pin level is high, the ready state is set). after detection of the ready state, set the port mode register to 0 and return to the output mode. (11)sbi mode precautions (a) slave selection/non-selection is detected by match detection of the slave address received after bus release (reld = 1). for this match detection, the match interrupt (csiif0) of the address to be generated with wup = 1 is normally used. thus, execute selection/non-selection detection by slave address when wup = 1. (b) when detecting selection/non-selection without the use of an interrupt with wup = 0, do so by means of transmission/reception of the command preset by program instead of using the address match detection method. (c) in sbi, after specifying reset of busy, the busy signal is output until the fall of the next serial clock (sck0). if wup = 1 is set during this interval by mistake, it will be impossible to reset busy. therefore, after busy is released, make sure that the sb0 (sb1) pin is high level before setting wup = 1.
chapter 13 serial interface channel 0 249 user s manual u11302ej4v0um (d) for the pin that is to be used for data i/o, be sure to set as follows before serial transfer of the 1st byte after reset input. [1] set the p25 and p26 output latches to 1. [2] set bit 0 (relt) of the serial bus interface control register (sbic) to 1. [3] reset the p25 and p26 output latches from 1 to 0. (e) if the sb0 (sb1) line changes from low level to high level or from high level to low level while the sck0 line is high level, it is recognized as either a bus release signal or a command signal. therefore, if the changing timing of the bus fluctuates because of substrate capacitance, etc., it may be recognized as a bus release signal (or a command signal) even while data is being transmitted. care should therefore be taken in the wiring. 13.4.4 2-wire serial i/o mode operation the 2-wire serial i/o mode can handle any communication format by program. communication is basically carried out using two lines: a serial clock (sck0) and serial data input/output (sb0 or sb1). figure 13-30. serial bus configuration example using 2-wire serial i/o mode (1) register setting the 2-wire serial i/o mode is set by serial operating mode register 0 (csim0), the serial bus interface control register (sbic), and the interrupt timing specification register (sint). master sck0 slave sb0 (sb1) sck0 sb0 (sb1) v dd v dd
chapter 13 serial interface channel 0 250 user s manual u11302ej4v0um pm25 p25 pm26 p26 pm27 p27 (a) serial operating mode register 0 (csim0) csim0 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim0 to 00h. r/w csim csim serial interface channel 0 clock selection 01 00 0 input clock to sck0 pin from off-chip 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 0 to 3 of timer clock select register 3 (tcl3) r/w csim csim csim operating start si0/p25 so0/p26 sck0/p27 04 03 02 mode bit pin function pin function pin function 0 3-wire serial i/o mode (refer to 13.4.2 3-wire serial i/o mode operation ) 1 0 sbi mode (refer to 13.4.3 sbi mode operation ) note 2 note 2 2-wire serial msb p25 sb1 sck0 0 0001 i/o mode (cmos i/o) (n-ch open-drain (n-ch open-drain i/o) i/o) 11 note 2 note 2 sb0 p26 100 0 1 (n-ch open-drain (cmos i/o) i/o) r/w wup wakeup function control note 3 0 interrupt request signal generation with each serial transfer in any mode interrupt request signal generation when the address received after bus release (when cmdd = reld = 1) matches the 1 slave address register (sva) in sbi mode r coi slave address comparison result flag note 4 0 slave address register (sva) not equal to serial i/o shift register 0 (sio0) data 1 slave address register (sva) equal to serial i/o shift register 0 (sio0) data r/w csie0 serial interface channel 0 operation control 0 operation stopped 1 operation enabled notes 1. bit 6 (coi) is a read-only bit. 2. can be used freely as port function. 3. set wup to 0 when the 2-wire serial i/o mode is selected. 4. when csie0 = 0, coi becomes 0. remark : don t care pm : port mode register p : port output latch csie0 coi wup csim 04 csim 03 csim 02 csim 01 csim 00 <7><6><5>43210 csim0 symbol ff60h 00h r/w note 1 address after reset r/w
chapter 13 serial interface channel 0 251 user s manual u11302ej4v0um (b) serial bus interface control register (sbic) sbic is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sbic to 00h. r/w when relt = 1, the so latch is set to 1. after so latch setting, relt is automatically cleared to 0. relt also cleared to 0 when csie0 = 0. r/w when cmdt = 1, the so latch is cleared to 0. after so latch clearance, cmdt is automatically cleared to 0. cmdt also cleared to 0 when csie0 = 0. csie0: bit 7 of serial operating mode register 0 (csim0) <6> <5> <4> <3> <2> <1> <0> <7> symbol sbic bsye ackd acke ackt cmdd reld cmdt relt ff61h 00h r/w address after reset r/w
chapter 13 serial interface channel 0 252 user s manual u11302ej4v0um (c) interrupt timing specification register (sint) sint is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets sint to 00h. notes 1. bit 6 (cld) is a read-only bit. 2. when csie0 = 0, cld becomes 0. caution be sure to set bits 0 to 3 to 0. remark sva: slave address register csiif0: interrupt request flag for intcsi0 csie0: bit 7 of serial operating mode register 0 (csim0) <6><5><4>3210 7 symbol sint 0 cld sic svam 0 0 0 0 ff63h 00h r/w note 1 address after reset r/w svam 0 1 sva bit to be used as slave address bits 0 to 7 bits 1 to 7 sic 0 1 intcsi0 interrupt source selection csiif0 is set upon termination of serial interface channel 0 transfer csiif0 is set upon bus release detection or termination of serial interface channel 0 transfer cld 0 1 sck0 pin level note 2 low level high level r/w r/w r
chapter 13 serial interface channel 0 253 user s manual u11302ej4v0um (2) communication operation the 2-wire serial i/o mode is used for data transmission/reception in 8-bit units. data transmission/ reception is carried out bit by bit in synchronization with the serial clock. shift operations of serial i/o shift register 0 (sio0) are carried out in synchronization with the falling edge of the serial clock (sck0). the transmit data is held in the so0 latch and is output from the sb0/p25 (or sb1/p26) pin with the msb set as the start bit. the receive data input from the sb0 (or sb1) pin is latched into sio0 at the rising edge of sck0. upon termination of 8-bit transfer, sio0 operation stops automatically and the interrupt request flag (csiif0) is set. figure 13-31. 2-wire serial i/o mode timing the sb0 (sb1) pin specified for the serial data bus is an n-ch open-drain i/o and thus it must be externally pulled up. because the n-ch open-drain output must be high impedance for data reception, write ffh to sio0 in advance. the sb0 (or sb1) pin generates the so0 latch status and thus the sb0 (or sb1) pin output status can be manipulated by setting bit 0 (relt) and bit 1 (cmdt) of the serial bus interface control register (sbic). however, do not carry out this manipulation during serial transfer. control the sck0 pin output level in the output mode (internal system clock mode) by manipulating the p27 output latch (refer to 13.4.5 sck0/p27 pin output manipulation ). 123 4 5 6 7 8 sck0 d7 d6 d5 d4 d3 d2 d1 d0 sb0/sb1 csiif0 transfer start at the falling edge of sck0 end of transfer
chapter 13 serial interface channel 0 254 user s manual u11302ej4v0um (4) transfer start serial transfer is started by setting transfer data to serial i/o shift register 0 (sio0) when the following two conditions are satisfied. serial interface channel 0 operation control bit (csie0) = 1 internal serial clock is stopped or sck0 is at high level after 8-bit serial transfer. cautions 1. if csie0 is set to 1 after data write to sio0, transfer does not start. 2. because the n-ch open-drain output must be high impedance for data reception, write ffh to sio0 in advance. upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (csiif0) is set. (5) error detection in the 2-wire serial i/o mode, the serial bus sb0 (sb1) status being transmitted is fetched into serial i/ o shift register 0 (sio0) of the transmitting device. thus, transmit errors can be detected in the following two ways. (a) comparison of sio0 data before transmission to that after transmission in this case, if the two data differ, a transmit error is judged to have occurred. (b) use of the slave address register (sva) transmit data is set to both sio0 and sva and is transmitted. after termination of transmission, the coi bit (match signal coming from the address comparator) of serial operating mode register 0 (csim0) is tested. if 1 , normal transmission is judged to have been carried out. if 0 , a transmit error is judged to have occurred. (3) signals figure 13-32 shows the relt and cmdt operations. figure 13-32. relt and cmdt operations relt cmdt so0 latch
chapter 13 serial interface channel 0 255 user s manual u11302ej4v0um 13.4.5 sck0/p27 pin output manipulation because the sck0/p27 pin incorporates an output latch, static output is also possible by software in addition to normal serial clock output. p27 output latch manipulation enables any value of sck0 to be set by software (si0/sb0 and so0/sb1 pins to be controlled with bit 0 (relt) and bit 1 (cmdt) of the serial bus interface control register (sbic)). the sck0/p27 pin output manipulation procedure is described below. [1] set serial operating mode register 0 (csim0) (sck0 pin enabled for serial operation in the output mode). sck0 = 1 with serial transfer suspended. [2] manipulate the p27 output latch with a bit manipulation instruction. figure 13-33. sck0/p27 pin configuration to internal circuit sck0/p27 p27 output latch from serial clock controller sck0 (set to 1 while transfer is stopped) when csie0 = 1 and csim01 and csim00 = 1, 0 or 1, 1, respectively set with a bit manipulation instruction
256 user? manual u11302ej4v0um chapter 14 serial interface channel 1 14.1 functions of serial interface channel 1 serial interface channel 1 has the following three modes. table 14-1. modes of serial interface channel 1 operation mode pins used features usage operation stop mode 3-wire serial i/o mode (msb-/lsb-first switchable) 3-wire serial i/o mode with automatic transmit/ receive function (msb-/lsb-first switchable) sck1 (serial clock), so1 (serial output), si1 (serial input) sck1 (serial clock), so1 (serial output), si1 (serial input) used when serial transfer is not carried out. power consumption can be reduced. input and output lines are independent and they can transfer/receive at the same time, so the data transfer processing time is short. the start bit of 8-bit data to undergo serial transfer is switchable between msb and lsb. mode with same function as 3-wire serial i/o mode above plus automatic transmit/receive function. can transmit/receive data with a maximum of 64 bytes. therefore, this function enables the hardware to transmit/receive data to/from the osd (on screen display) device and device with on-chip display controller/driver independently of the cpu thus the software load can be reduced. these modes are used for connection of peripheral ics and display controllers that incorporate a clocked serial interface.
chapter 14 serial interface channel 1 257 user? manual u11302ej4v0um 14.2 configuration of serial interface channel 1 serial interface channel 1 consists of the following hardware. table 14-2. configuration of serial interface channel 1 item configuration registers serial i/o shift register 1 (sio1) automatic data transmit/receive address pointer (adtp) control registers timer clock select register 3 (tcl3) serial operating mode register 1 (csim1) automatic data transmit/receive control register (adtc) automatic data transmit/receive interval specification register (adti) port mode register 2 (pm2) note note refer to figure 4-5 block diagram of p20, p21, p23 to p26 and figure 4-6 block diagram of p22 and p27 .
chapter 14 serial interface channel 1 258 user? manual u11302ej4v0um figure 14-1. block diagram of serial interface channel 1 re arld erce err trf strb busy 1 busy 0 internal bus automatic data transmit/ receive control register csie1 dir ate csim 11 csim 10 serial operating mode register 1 adti 7 adti 4 adti 3 automatic data transmit/ receive interval specification register adti 2 adti 1 adti 0 5-bit counter serial i/o shift register 1 (sio1) hand- shake serial clock counter selector si1/p20 so1/p21 pm21 stb/p23 pm23 p21 output latch busy/p24 ate dir dir buffer ram automatic data transmit/receive address pointer (adtp) sck1/p22 pm22 internal bus arld q r s p22 output latch sio1 write match adti0 to adti4 selector selector tcl 37 tcl 36 tcl 35 tcl 34 4 to2 timer clock select register 3 f x /2 2 to f x /2 9 internal bus intcsi1 clear
chapter 14 serial interface channel 1 259 user s manual u11302ej4v0um (1) serial i/o shift register 1 (sio1) this is an 8-bit register used to carry out parallel/serial conversion and serial transmission/reception (shift operations) in synchronization with the serial clock. sio1 is set with an 8-bit memory manipulation instruction. when bit 7 (csie1) of serial operating mode register 1 (csim1) is 1, writing data to sio1 starts serial operation. in transmission, data written to sio1 is output to the serial output (so1). in reception, data is read from the serial input (si1) to sio1. reset input makes sio1 undefined. caution do not write data to sio1 while the automatic transmit/receive function is activated. (2) automatic data transmit/receive address pointer (adtp) this register stores the value of (the number of transmit data bytes 1) while the automatic transmit/ receive function is activated. it is decremented automatically with data transmission/reception. adtp is set with an 8-bit memory manipulation instruction. the higher 3 bits must be set to 0. reset input sets adtp to 00h. caution do not write data to adtp while the automatic transmit/receive function is activated. (3) serial clock counter this counter counts the serial clocks to be output and input during transmission/reception and checks whether 8-bit data has been transmitted/received.
chapter 14 serial interface channel 1 260 user s manual u11302ej4v0um 14.3 control registers of serial interface channel 1 the following four registers are used to control serial interface channel 1. timer clock select register 3 (tcl3) serial operating mode register 1 (csim1) automatic data transmit/receive control register (adtc) automatic data transmit/receive interval specification register (adti)
chapter 14 serial interface channel 1 261 user s manual u11302ej4v0um (1) timer clock select register 3 (tcl3) this register sets the serial clock of serial interface channel 1. tcl3 is set with an 8-bit memory manipulation instruction. reset input sets tcl3 to 88h. remark besides setting the serial clock of serial interface channel 1, tcl3 sets the serial clock of serial interface channel 0. figure 14-2. format of timer clock select register 3 caution if tcl3 is to be rewritten with data that is not identical, stop the serial transfer first. remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. tcl30 tcl3 765432 symbol 10 tcl33 serial interface channel 0 serial clock selection ff43h tcl31 tcl33 tcl32 tcl34 tcl35 tcl36 tcl37 address after reset r/w 88h r/w 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) setting prohibited tcl32 1 1 0 0 0 0 1 1 tcl31 1 1 0 0 1 1 0 0 other than above tcl30 0 1 0 1 0 1 0 1 tcl37 serial interface channel 1 serial clock selection 0 f x /2 2 (1.25 mhz) 0 f x /2 3 (625 khz) 1 f x /2 4 (313 khz) 1 f x /2 5 (156 khz) 1 f x /2 6 (78.1 khz) 1 f x /2 7 (39.1 khz) 1 f x /2 8 (19.5 khz) 1 f x /2 9 (9.8 khz) setting prohibited tcl36 1 1 0 0 0 0 1 1 tcl35 1 1 0 0 1 1 0 0 other than above tcl34 0 1 0 1 0 1 0 1
chapter 14 serial interface channel 1 262 user s manual u11302ej4v0um csim csim serial interface channel 1 clock selection 11 10 0 clock externally input to sck1 pin note 1 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 4 to 7 of timer clock select register 3 (tcl3) ate serial interface channel 1 operating mode selection 0 3-wire serial i/o mode 1 3-wire serial i/o mode with automatic transmit/receive function dir start bit si1 pin function so1 pin function 0 msb si1/p20 (input) so1 (cmos output) 1 lsb csim shift register serial clock counter si1/p20 so1/p21 sck1/p22 csie1 pm20 p20 pm21 p21 pm22 p22 11 1 operation operation control pin function pin function pin function note 2 note 2 note 2 note 2 note 2 note 2 operation stop clear p20 p21 p22 0 (cmos i/o) (cmos i/o) (cmos i/o) operation enable count operation si1 note 3 so1 sck1 01 note 3 note 3 (input) (cmos output) (input) 11 00 sck1 101 (cmos output) notes 1. if external clock input has been selected with csim11 set to 0, set bit 1 (busy1) and bit 2 (strb) of the automatic data transmit/receive control register (adtc) to 0, 0. 2. can be used freely as a port pin. 3. can be used as p20 when used only for transmission (set bit 7 (re) of adtc to 0). remark : don t care pm : port mode register p : port output latch (2) serial operating mode register 1 (csim1) this register sets the serial interface channel 1 serial clock, operating mode, operation enable/stop, and automatic transmit/receive operation enable/stop. csim1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim1 to 00h. figure 14-3. format of serial operating mode register 1 csie1 dir ate 0 0 0 csim 11 csim 10 <7>6<5>43210 csim1 symbol ff68h 00h r/w address after reset r/w
chapter 14 serial interface channel 1 263 user s manual u11302ej4v0um (3) automatic data transmit/receive control register (adtc) this register sets automatic receive enable/disable, the operating mode, strobe output enable/disable, busy input enable/disable, error check enable/disable, and displays automatic transmit/receive execution and error detection. adtc is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets adtc to 00h.
chapter 14 serial interface channel 1 264 user? manual u11302ej4v0um figure 14-4. format of automatic data transmit/receive control register notes 1. bits 3 and 4 (trf and err) are read-only bits. 2. the termination of automatic transmission/reception should be judged by using trf, not csiif1 (interrupt request flag). caution when external clock input is selected with bit 1 (csim11) of serial operating mode register 1 (csim1) set to 0, set strb and busy1 of adtc to 0, 0. remark : don? care <6> <5> <4> <3> <2> <1> <0> <7> symbol adtc re arld erce err trf strb busy1 busy0 ff69h 00h r/w note 1 address after reset r/w busy1 0 1 1 busy input control not using busy input busy input enabled (active high) busy input enabled (active low) busy0 0 1 strb 0 1 strobe output control strobe output disabled strobe output enabled trf 1 status of automatic transmit/receive function note 2 detection of termination of automatic transmission/ reception (this bit is set to 0 upon suspension of automatic transmission/reception or when arld = 0.) during automatic transmission/reception (this bit is set to 1 when data is written to sio1.) r/w r/w r r err 0 1 error detection of automatic transmit/receive function no error (this bit is set to 0 when data is written to sio1.) error occurred r/w arld 0 1 operating mode selection of automatic transmit/ receive function single operating mode repetitive operating mode r/w re 0 1 receive control of automatic transmit/receive function receive disabled receive enabled r/w erce 0 error check control of automatic transmit/ receive function error check disabled error check enabled (only when busy1 = 1) 0 1
chapter 14 serial interface channel 1 265 user s manual u11302ej4v0um (4) automatic data transmit/receive interval specification register (adti) this register sets the automatic transmit/receive function data transfer interval. adti is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets adti to 00h. figure 14-5. format of automatic data transmit/receive interval specification register (1/2) adti7 data transfer interval control 0 no control of interval by adti note 1 1 control of interval by adti (adti0 to adti4) data transfer interval specification (f x = 5.0 mhz operation) adti4 adti3 adti2 adti1 adti0 minimum note 2 maximum note 2 00000 36.8 s + 0.5/f sck 40.0 s + 1.5/f sck 00001 62.4 s + 0.5/f sck 65.6 s + 1.5/f sck 00010 88.0 s + 0.5/f sck 91.2 s + 1.5/f sck 00011 113.6 s + 0.5/f sck 116.8 s + 1.5/f sck 00100 139.2 s + 0.5/f sck 142.4 s + 1.5/f sck 00101 164.8 s + 0.5/f sck 168.0 s + 1.5/f sck 00110 190.4 s + 0.5/f sck 193.6 s + 1.5/f sck 00111 216.0 s + 0.5/f sck 219.2 s + 1.5/f sck 01000 241.6 s + 0.5/f sck 244.8 s + 1.5/f sck 01001 267.2 s + 0.5/f sck 270.4 s + 1.5/f sck 01010 292.8 s + 0.5/f sck 296.0 s + 1.5/f sck 01011 318.4 s + 0.5/f sck 321.6 s + 1.5/f sck 01100 344.0 s + 0.5/f sck 347.2 s + 1.5/f sck 01101 369.6 s + 0.5/f sck 372.8 s + 1.5/f sck 01110 395.2 s + 0.5/f sck 398.4 s + 1.5/f sck 01111 420.8 s + 0.5/f sck 424.0 s + 1.5/f sck 6543210 7 symbol adti adti7 0 0 adti4 adti3 adti2 adti1 adti0 ff6bh 00h r/w address after reset r/w
chapter 14 serial interface channel 1 266 user s manual u11302ej4v0um notes 1. the interval is dependent only on cpu processing. 2. the data transfer interval includes an error. the data transfer minimum and maximum intervals are found from the following expressions (n: value set in adti0 to adti4). however, if the minimum calculated by the following expression is smaller than 2/f sck , the minimum interval time is 2/f sck . 2 7 56 0.5 minimum = (n + 1) ++ f x f x f sck 2 7 72 1.5 maximum = (n + 1) ++ f x f x f sck cautions 1. adti should not be written to during operation of the automatic transmit/receive function. 2. bits 5 and 6 must be set to 0. 3. when adti is used to control the interval time of data transfer by automatic transmit/ receive function, busy control (refer to 14.4.3 (4) (a) busy control option) is invalid. remarks 1. f x : main system clock oscillation frequency 2. f sck : serial clock frequency
chapter 14 serial interface channel 1 267 user s manual u11302ej4v0um figure 14-5. format of automatic data transmit/receive interval specification register (2/2) data transfer interval specification (f x = 5.0 mhz operation) adti4 adti3 adti2 adti1 adti0 minimum note maximum note 10000 446.4 s + 0.5/f sck 449.6 s + 1.5/f sck 10001 472.0 s + 0.5/f sck 475.2 s + 1.5/f sck 10010 497.6 s + 0.5/f sck 500.8 s + 1.5/f sck 10011 523.2 s + 0.5/f sck 526.4 s + 1.5/f sck 10100 548.8 s + 0.5/f sck 552.0 s + 1.5/f sck 10101 574.4 s + 0.5/f sck 577.6 s + 1.5/f sck 10110 600.0 s + 0.5/f sck 603.2 s + 1.5/f sck 10111 625.6 s + 0.5/f sck 628.8 s + 1.5/f sck 11000 651.2 s + 0.5/f sck 654.4 s + 1.5/f sck 11001 676.8 s + 0.5/f sck 680.0 s + 1.5/f sck 11010 702.4 s + 0.5/f sck 705.6 s + 1.5/f sck 11011 728.0 s + 0.5/f sck 731.2 s + 1.5/f sck 11100 753.6 s + 0.5/f sck 756.8 s + 1.5/f sck 11101 779.2 s + 0.5/f sck 782.4 s + 1.5/f sck 11110 804.8 s + 0.5/f sck 808.0 s + 1.5/f sck 11111 830.4 s + 0.5/f sck 833.6 s + 1.5/f sck note the data transfer interval includes an error. the data transfer minimum and maximum intervals are found from the following expressions (n: value set in adti0 to adti4). however, if the minimum calculated by the following expression is smaller than 2/f sck , the minimum interval time is 2/f sck . 2 7 56 0.5 minimum = (n + 1) ++ f x f x f sck 2 7 72 1.5 maximum = (n + 1) ++ f x f x f sck cautions 1. adti should not be written to during operation of the automatic transmit/receive function. 2. bits 5 and 6 must be set to 0. 3. when adti is used to control the interval time of data transfer by automatic transmit/ receive function, busy control (refer to 14.4.3 (4) (a) busy control option) is invalid. remarks 1. f x : main system clock oscillation frequency 2. f sck : serial clock frequency 6543210 7 symbol adti adti7 0 0 adti4 adti3 adti2 adti1 adti0 ff6bh 00h r/w address after reset r/w
chapter 14 serial interface channel 1 268 user s manual u11302ej4v0um csim shift register serial clock counter si1/p20 so1/p21 sck1/p22 csie1 pm20 p20 pm21 p21 pm22 p22 11 1 operation operation control pin function pin function pin function note 1 note 1 note 1 note 1 note 1 note 1 operation stop clear p20 p21 p22 0 (cmos i/o) (cmos i/o) (cmos i/o) operation enable count operation si1 note 2 so1 sck1 01 note 2 note 2 (input) (cmos output) (input) 11 00 sck1 101 (cmos output) notes 1. can be used freely as a port pin. 2. can be used as p20 (cmos i/o) when used only for transmission (set bit 7 (re) of the automatic data transmit/receive control register (adtc) to 0). remark : don t care pm : port mode register p : port output latch 14.4 operations of serial interface channel 1 the following three operating modes are available for serial interface channel 1. operation stop mode 3-wire serial i/o mode 3-wire serial i/o mode with automatic transmit/receive function 14.4.1 operation stop mode serial transfer is not carried out in the operation stop mode. thus, power consumption can be reduced. serial i/o shift register 1 (sio1) does not carry out shift operations and can be used as an ordinary 8-bit register. in the operation stop mode, the p20/si1, p21/so1, p22/sck1, p23/stb, and p24/busy pins can be used as ordinary i/o ports. (1) register setting the operation stop mode is set by serial operating mode register 1 (csim1). csim1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim1 to 00h. csie1 dir ate 0 0 0 csim 11 csim 10 <7>6<5>43210 csim1 symbol ff68h 00h r/w address after reset r/w
chapter 14 serial interface channel 1 269 user s manual u11302ej4v0um 14.4.2 3-wire serial i/o mode operation the 3-wire serial i/o mode is used for connection of peripheral ics and display controllers that incorporate a clocked serial interface. communication is carried out using three lines: a serial clock (sck1), serial output (so1), and serial input (si1). (1) register setting the 3-wire serial i/o mode is set by serial operating mode register 1 (csim1). csim1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim1 to 00h. csim csim serial interface channel 1 clock selection 11 10 0 x clock externally input to sck1 pin note 1 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 4 to 7 of timer clock select register 3 (tcl3) ate serial interface channel 1 operating mode selection 0 3-wire serial i/o mode 1 3-wire serial i/o mode with automatic transmit/receive function dir start bit si1 pin function so1 pin function 0 msb si1/p20 (input) so1 (cmos output) 1 lsb csim shift register serial clock counter si1/p20 so1/p21 sck1/p22 csie1 pm20 p20 pm21 p21 pm22 p22 11 1 operation operation control pin function pin function pin function note 2 note 2 note 2 note 2 note 2 note 2 operation stop clear p20 p21 p22 0 (cmos i/o) (cmos i/o) (cmos i/o) operation enable count operation si1 note 3 so1 sck1 01 note 3 note 3 (input) (cmos output) (input) 11 00 sck1 101 (cmos output) notes 1. if external clock input has been selected with csim11 set to 0, set bit 1 (busy1) and bit 2 (strb) of the automatic data transmit/receive control register (adtc) to 0, 0. 2. can be used freely as a port pin. 3. can be used as p20 when used only for transmission (set bit 7 (re) of adtc to 0). remark : don t care pm : port mode register p : port output latch csie1 dir ate 0 0 0 csim 11 csim 10 <7>6<5>43210 csim1 symbol ff68h 00h r/w address after reset r/w
chapter 14 serial interface channel 1 270 user s manual u11302ej4v0um (2) communication operation the 3-wire serial i/o mode is used for data transmission/reception in 8-bit units. data transmission/ reception is carried out bit by bit in synchronization with the serial clock. shift operations of serial i/o shift register 1 (sio1) are carried out at the falling edge of the serial clock (sck1). the transmit data is held in the so1 latch and is output from the so1 pin. the receive data input to the si1 pin is latched into sio1 at the rising edge of sck1. upon termination of 8-bit transfer, the sio1 operation stops automatically and the interrupt request flag (csiif1) is set. figure 14-6. 3-wire serial i/o mode timing si1 sck1 12345678 di7 di6 di5 di4 di3 di2 di1 di0 so1 do7 do6 do5 do4 do3 do2 do1 do0 csiif1 transfer start at the falling edge of sck1 end of transfer sio1 write caution the so1 pin becomes low level by sio1 write.
chapter 14 serial interface channel 1 271 user s manual u11302ej4v0um (3) msb/lsb switching as the start bit in the 3-wire serial i/o mode, transfer can be selected to start from the msb or lsb. figure 14-7 shows the configuration of serial i/o shift register 1 (sio1) and the internal bus. as shown in the figure, the msb/lsb can be read/written in reverse form. msb/lsb switching as the start bit can be specified using bit 6 (dir) of serial operating mode register 1 (csim1). figure 14-7. circuit for switching transfer bit order 7 6 internal bus 1 0 lsb-first msb-first read/write gate si1 shift register 1 (sio1) read/write gate so1 sck1 dq so1 latch start bit switching is realized by switching the bit order for data write to sio1. the sio1 shift order remains unchanged. thus, switching between msb-first and lsb-first must be performed before writing data to the shift register. (4) transfer start serial transfer is started by setting transfer data to serial i/o shift register 1 (sio1) when the following two conditions are satisfied. serial interface channel 1 operation control bit (csie1) = 1 internal serial clock is stopped or sck1 is at high level after 8-bit serial transfer. caution if csie1 is set to ??after data write to sio1, transfer does not start. upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (csiif1) is set.
chapter 14 serial interface channel 1 272 user s manual u11302ej4v0um 14.4.3 3-wire serial i/o mode operation with automatic transmit/receive function this 3-wire serial i/o mode is used for transmission/reception of up to 64-byte data without using software. once transfer is started, the set number of bytes of the data prestored in the ram can be transmitted, and the set number of bytes of data can be received and stored in the ram. handshake signals (stb and busy) are supported by hardware to transmit/receive data continuously. an osd (on screen display) lsi and peripheral lsi including an lcd controller/driver can be connected without difficulty. (1) register setting the 3-wire serial i/o mode with automatic transmit/receive function is set by serial operating mode register 1 (csim1), the automatic data transmit/receive control register (adtc), and the automatic data transmit/receive interval specification register (adti).
chapter 14 serial interface channel 1 273 user? manual u11302ej4v0um (a) serial operating mode register 1 (csim1) csim1 is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets csim1 to 00h. csim csim serial interface channel 1 clock selection 11 10 0 clock externally input to sck1 pin note 1 1 0 8-bit timer register 2 (tm2) output 1 1 clock specified with bits 4 to 7 of timer clock select register 3 (tcl3) ate serial interface channel 1 operating mode selection 0 3-wire serial i/o mode 1 3-wire serial i/o mode with automatic transmit/receive function dir start bit si1 pin function so1 pin function 0 msb si1/p20 (input) so1 (cmos output) 1 lsb csim shift register serial clock counter si1/p20 so1/p21 sck1/p22 csie1 pm20 p20 pm21 p21 pm22 p22 11 1 operation operation control pin function pin function pin function note 2 note 2 note 2 note 2 note 2 note 2 operation stop clear p20 p21 p22 0 (cmos i/o) (cmos i/o) (cmos i/o) operation enable count operation si1 note 3 so1 sck1 01 note 3 note 3 (input) (cmos output) (input) 11 00 sck1 101 (cmos output) notes 1. if external clock input has been selected with csim11 set to 0, set bit 1 (busy1) and bit 2 (strb) of the automatic data transmit/receive control register (adtc) to 0, 0. 2. can be used freely as a port pin. 3. can be used as p20 when used only for transmission (set bit 7 (re) of adtc to 0). remark : don? care pm : port mode register p : port output latch csie1 dir ate 0 0 0 csim 11 csim 10 <7>6<5>43210 csim1 symbol ff68h 00h r/w address after reset r/w
chapter 14 serial interface channel 1 274 user s manual u11302ej4v0um (b) automatic data transmit/receive control register (adtc) adtc is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets adtc to 00h. notes 1. bits 3 and 4 (trf and err) are read-only bits. 2. the termination of automatic transmission/reception should be judged by using trf, not csiif1 (interrupt request flag). caution when external clock input is selected with bit 1 (csim11) of serial operating mode register 1 (csim1) set to 0, set strb and busy1 of adtc to 0, 0 (handshake control cannot be executed when an external clock is input). remark : don t care <6> <5> <4> <3> <2> <1> <0> <7> symbol adtc re arld erce err trf strb busy1 busy0 ff69h 00h r/w note 1 address after reset r/w busy1 0 1 1 busy input control not using busy input busy input enabled (active high) busy input enabled (active low) busy0 x 0 1 strb 0 1 strobe output control strobe output disabled strobe output enabled trf 1 status of automatic transmit/receive function note 2 detection of termination of automatic transmission/ reception (this bit is set to 0 upon suspension of automatic transmission/reception or when arld = 0.) during automatic transmission/reception (this bit is set to 1 when data is written to sio1.) r/w r/w r r err 0 1 error detection of automatic transmit/receive function no error (this bit is set to 0 when data is written to sio1.) error occurred r/w arld 0 1 operating mode selection of automatic transmit/ receive function single operating mode repetitive operating mode r/w re 0 1 receive control of automatic transmit/receive function receive disabled receive enabled r/w erce 0 error check control of automatic transmit/ receive function error check disabled error check enabled (only when busy1 = 1) 0 1
chapter 14 serial interface channel 1 275 user s manual u11302ej4v0um (c) automatic data transmit/receive interval specification register (adti) this register sets the data transfer interval of the automatic transmit/receive function. adti is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets adti to 00h. adti7 data transfer interval control 0 no control of interval by adti note 1 1 control of interval by adti (adti0 to adti4) data transfer interval specification (f x = 5.0 mhz operation) adti4 adti3 adti2 adti1 adti0 minimum note 2 maximum note 2 00000 36.8 s + 0.5/f sck 40.0 s + 1.5/f sck 00001 62.4 s + 0.5/f sck 65.6 s + 1.5/f sck 00010 88.0 s + 0.5/f sck 91.2 s + 1.5/f sck 00011 113.6 s + 0.5/f sck 116.8 s + 1.5/f sck 00100 139.2 s + 0.5/f sck 142.4 s + 1.5/f sck 00101 164.8 s + 0.5/f sck 168.0 s + 1.5/f sck 00110 190.4 s + 0.5/f sck 193.6 s + 1.5/f sck 00111 216.0 s + 0.5/f sck 219.2 s + 1.5/f sck 01000 241.6 s + 0.5/f sck 244.8 s + 1.5/f sck 01001 267.2 s + 0.5/f sck 270.4 s + 1.5/f sck 01010 292.8 s + 0.5/f sck 296.0 s + 1.5/f sck 01011 318.4 s + 0.5/f sck 321.6 s + 1.5/f sck 01100 344.0 s + 0.5/f sck 347.2 s + 1.5/f sck 01101 369.6 s + 0.5/f sck 372.8 s + 1.5/f sck 01110 395.2 s + 0.5/f sck 398.4 s + 1.5/f sck 01111 420.8 s + 0.5/f sck 424.0 s + 1.5/f sck 6543210 7 symbol adti adti7 0 0 adti4 adti3 adti2 adti1 adti0 ff6bh 00h r/w address after reset r/w
chapter 14 serial interface channel 1 276 user s manual u11302ej4v0um notes 1. the interval is dependent only on cpu processing. 2. the data transfer interval includes an error. the data transfer minimum and maximum intervals are found from the following expressions (n: value set in adti0 to adti4). however, if the minimum calculated by the following expression is smaller than 2/f sck , the minimum interval time is 2/f sck . 2 7 56 0.5 minimum = (n + 1) ++ f x f x f sck 2 7 72 1.5 maximum = (n + 1) ++ f x f x f sck cautions 1. adti should not be written to during operation of the automatic transmit/receive function. 2. bits 5 and 6 must be set to 0. 3. when adti is used to control the interval time of data transfer by automatic transmit/receive function, busy control (refer to 14.4.3 (4) (a) busy control option) is invalid. remarks 1. f x : main system clock oscillation frequency 2. f sck : serial clock frequency
chapter 14 serial interface channel 1 277 user s manual u11302ej4v0um data transfer interval specification (f x = 5.0 mhz operation) adti4 adti3 adti2 adti1 adti0 minimum note maximum note 10000 446.4 s + 0.5/f sck 449.6 s + 1.5/f sck 10001 472.0 s + 0.5/f sck 475.2 s + 1.5/f sck 10010 497.6 s + 0.5/f sck 500.8 s + 1.5/f sck 10011 523.2 s + 0.5/f sck 526.4 s + 1.5/f sck 10100 548.8 s + 0.5/f sck 552.0 s + 1.5/f sck 10101 574.4 s + 0.5/f sck 577.6 s + 1.5/f sck 10110 600.0 s + 0.5/f sck 603.2 s + 1.5/f sck 10111 625.6 s + 0.5/f sck 628.8 s + 1.5/f sck 11000 651.2 s + 0.5/f sck 654.4 s + 1.5/f sck 11001 676.8 s + 0.5/f sck 680.0 s + 1.5/f sck 11010 702.4 s + 0.5/f sck 705.6 s + 1.5/f sck 11011 728.0 s + 0.5/f sck 731.2 s + 1.5/f sck 11100 753.6 s + 0.5/f sck 756.8 s + 1.5/f sck 11101 779.2 s + 0.5/f sck 782.4 s + 1.5/f sck 11110 804.8 s + 0.5/f sck 808.0 s + 1.5/f sck 11111 830.4 s + 0.5/f sck 833.6 s + 1.5/f sck note the data transfer interval includes an error. the data transfer minimum and maximum intervals are found from the following expressions (n: value set in adti0 to adti4). however, if the minimum calculated by the following expression is smaller than 2/f sck , the minimum interval time is 2/f sck . 2 7 56 0.5 minimum = (n + 1) ++ f x f x f sck 2 7 72 1.5 maximum = (n + 1) ++ f x f x f sck cautions 1. adti should not be written to during operation of the automatic transmit/receive function. 2. bits 5 and 6 must be set to 0. 3. when adti is used to control the interval time of data transfer by automatic transmit/ receive function, busy control (refer to 14.4.3 (4) (a) busy control option) is invalid. remarks 1. f x : main system clock oscillation frequency 2. f sck : serial clock frequency 6543210 7 symbol adti adti7 0 0 adti4 adti3 adti2 adti1 adti0 ff6bh 00h r/w address after reset r/w
chapter 14 serial interface channel 1 278 user s manual u11302ej4v0um (2) automatic transmit/receive data setting (a) transmit data setting [1] write transmit data from the least significant address of buffer ram, fac0h (up to faffh). the transmit data should be in the order from higher address to lower address. [2] set the automatic data transmit/receive address pointer (adtp) to the value obtained by subtracting 1 from the number of transmit data bytes. (b) automatic transmit/receive mode setting [1] set bit 7 (csie1) and bit 5 (ate) of serial operating mode register 1 (csim1) to 1. [2] set re of the automatic data transmit/receive control register (adtc) to 1. [3] set the data transmit/receive transfer interval in the automatic data transmit/receive interval specification register (adti). [4] write any value to serial i/o shift register 1 (sio1) (transfer start trigger). caution writing any value to sio1 orders the start of an automatic transmit/receive operation; the written value has no meaning. the following operations are automatically carried out when (a) and (b) are carried out. after the buffer ram data specified by adtp is transferred to sio1, transmission is carried out (start of automatic transmission/reception). the received data is written to the buffer ram address specified by adtp. adtp is decremented and the next data transmission/reception is carried out. data transmission/reception continues until the adtp decremental output becomes 00h and the data of address fac0h is output (end of automatic transmission/reception). when automatic transmission/reception is terminated, bit 3 (trf) of adtc is cleared to 0.
chapter 14 serial interface channel 1 279 user s manual u11302ej4v0um (3) communication operation (a) basic transmission/reception mode this transmission/reception mode is the same as the 3-wire serial i/o mode in which the specified number of data are transmitted/received in 8-bit units. serial transfer is started when any data is written to serial i/o shift register 1 (sio1) while bit 7 (csie1) of serial operating mode register 1 (csim1) is set to 1. upon completion of transmission of the last byte, the interrupt request flag (csiif1) is set. however, the termination of automatic transmission/reception should be judged by bit 3 (trf) of the automatic data transmit/receive control register (adtc), not csiif1. if busy control and strobe control are not executed, the p23/stb and p24/busy pins can be used as normal i/o ports. figure 14-8 shows the basic transmission/reception mode operation timing, and figure 14-9 shows the operation flowchart. the operation of the buffer ram to transmit/receive 6-byte data is shown in figure 14-10. figure 14-8. basic transmission/reception mode operation timing sck1 so1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 csiif1 trf si1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 interval cautions 1. because, in the basic transmission/reception mode, the automatic transmit/ receive function writes/reads data to/from the buffer ram after 1-byte transmission/ reception, an interval is inserted until the next transmission/reception. as the buffer ram write/read is performed at the same time as cpu processing, the maximum interval is dependent upon cpu processing and the value of the automatic data transmit/receive interval specification register (adti) (see (5) automatic transmit/receive interval). 2. when trf is cleared, the so1 pin becomes low level. remark csiif1: interrupt request flag trf: bit 3 of the automatic data transmit/receive control register (adtc)
chapter 14 serial interface channel 1 280 user s manual u11302ej4v0um figure 14-9. basic transmission/reception mode flowchart adtp: automatic data transmit/receive address pointer adti: automatic data transmit/receive interval specification register sio1: serial i/o shift register 1 trf: bit 3 of the automatic data transmit/receive control register (adtc) start write transmit data in buffer ram set adtp to the value (pointer value) obtained by subtracting 1 from the number of transmit data bytes set the transmission/reception operation interval time in adti write any data to sio1 (start trigger) write transmit data from buffer ram to sio1 transmission/reception operation write receive data from sio1 to buffer ram pointer value = 0 no trf = 0 no end yes yes decrement pointer value software execution hardware execution software execution
chapter 14 serial interface channel 1 281 user s manual u11302ej4v0um in 6-byte transmission/reception (arld = 0, re = 1) in basic transmission/reception mode, buffer ram operates as follows. (i) before transmission/reception (refer to figure 14-10 (a) ) after arbitrary data has been written to serial i/o shift register 1 (sio1) (start trigger: this data is not transferred), transmit data 1 (t1) is transferred from the buffer ram to sio1. when transmission of the first byte is completed, receive data 1 (r1) is transferred from sio1 to the buffer ram, and the automatic data transmit/receive address pointer (adtp) is decremented. then transmit data 2 (t2) is transferred from the buffer ram to sio1. (ii) 4th byte transmission/reception point (refer to figure 14-10 (b) ) transmission/reception of the third byte is completed, and transmit data 4 (t4) is transferred from the buffer ram to sio1. when transmission of the fourth byte is completed, receive data 4 (r4) is transferred from sio1 to the buffer ram, and adtp is decremented. (iii) completion of transmission/reception (refer to figure 14-10 (c) ) when transmission of the sixth byte is completed, receive data 6 (r6) is transferred from sio1 to the buffer ram, and the interrupt request flag (csiif1) is set (intcsi1 generation). figure 14-10. buffer ram operation in 6-byte transmission/reception (in basic transmission/reception mode) (1/2) (a) before transmission/reception transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h receive data 1 (r1) sio1 0 csiif1 5 adtp 1
chapter 14 serial interface channel 1 282 user s manual u11302ej4v0um figure 14-10. buffer ram operation in 6-byte transmission/reception (in basic transmission/reception mode) (2/2) (b) 4th byte transmission/reception point (c) completion of transmission/reception receive data 1 (r1) receive data 2 (r2) receive data 3 (r3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h receive data 4 (r4) sio1 0 csiif1 2 adtp 1 receive data 1 (r1) receive data 2 (r2) receive data 3 (r3) receive data 4 (r4) receive data 5 (r5) receive data 6 (r6) faffh fac5h fac0h sio1 1 csiif1 0 adtp
chapter 14 serial interface channel 1 283 user s manual u11302ej4v0um (b) basic transmission mode in this mode, the specified number of 8-bit unit data are transmitted. serial transfer is started when any data is written to serial i/o shift register 1 (sio1) while bit 7 (csie1) of serial operating mode register 1 (csim1) is set to 1. upon completion of transmission of the last byte, the interrupt request flag (csiif1) is set. however, the termination of automatic transmission/reception should be judged by bit 3 (trf) of the automatic data transmit/receive control register (adtc), not csiif1. if a receive operation, busy control, and strobe control are not executed, the p20/si1, p23/stb, and p24/busy pins can be used as normal i/o ports. figure 14-11 shows the basic transmission mode operation timing, and figure 14-12 shows the operation flowchart. the operation of the buffer ram to transmit 6-byte data in transmission mode is shown in figure 14-13. figure 14-11. basic transmission mode operation timing sck1 so1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 csiif1 trf interval cautions 1. because, in the basic transmission mode, the automatic transmit/receive function reads data from the buffer ram after 1-byte transmission, an interval is inserted until the next transmission. as the buffer ram read is performed at the same time as cpu processing, the maximum interval is dependent upon cpu processing and the value of the automatic data transmit/receive interval specification register (adti) (see (5) automatic transmit/receive interval). 2. when trf is cleared, the so1 pin becomes low level. remark csiif1: interrupt request flag trf: bit 3 of the automatic data transmit/receive control register (adtc)
chapter 14 serial interface channel 1 284 user s manual u11302ej4v0um figure 14-12. basic transmission mode flowchart adtp: automatic data transmit/receive address pointer adti: automatic data transmit/receive interval specification register sio1: serial i/o shift register 1 trf: bit 3 of the automatic data transmit/receive control register (adtc) start write transmit data in buffer ram set adtp to the value (pointer value) obtained by subtracting 1 from the number of transmit data bytes set the transmission/reception operation interval time in adti write any data to sio1 (start trigger) write transmit data from buffer ram to sio1 transmission operation pointer value = 0 no trf = 0 no end yes yes decrement pointer value software execution hardware execution software execution
chapter 14 serial interface channel 1 285 user s manual u11302ej4v0um in 6-byte transmission (arld = 0, re = 0) in basic transmission mode, buffer ram operates as follows. (i) before transmission (refer to figure 14-13 (a) ) after arbitrary data has been written to serial i/o shift register 1 (sio1) (start trigger: this data is not transferred), transmit data 1 (t1) is transferred from the buffer ram to sio1. when transmission of the first byte is completed, the automatic data transmit/receive address pointer (adtp) is decremented. then transmit data 2 (t2) is transferred from the buffer ram to sio1. (ii) 4th byte transmission point (refer to figure 14-13 (b) ) transmission of the third byte is completed, and transmit data 4 (t4) is transferred from the buffer ram to sio1. when transmission of the fourth byte is completed, adtp is decremented. (iii) completion of transmission (refer to figure 14-13 (c) ) when transmission of the sixth byte is completed, the interrupt request flag (csiif1) is set (intcsi1 generation). figure 14-13. buffer ram operation in 6-byte transmission (in basic transmission mode) (1/2) (a) before transmission transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 0 csiif1 5 adtp 1
chapter 14 serial interface channel 1 286 user s manual u11302ej4v0um figure 14-13. buffer ram operation in 6-byte transmission (in basic transmission mode) (2/2) (b) 4th byte transmission point (c) completion of transmission transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 0 csiif1 2 adtp 1 transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 1 csiif1 0 adtp
chapter 14 serial interface channel 1 287 user s manual u11302ej4v0um (c) repeat transmission mode in this mode, data stored in the buffer ram is transmitted repeatedly. serial transfer is started by writing any data to serial i/o shift register 1 (sio1) while bit 7 (csie1) of serial operating mode register 1 (csim1) is set to 1. unlike the basic transmission mode, after the last byte (data in address fac0h) has been transmitted, the interrupt request flag (csiif1) is not set, the value at the time the transmission was started is set in the automatic data transmit/receive address pointer (adtp) again, and the buffer ram contents are transmitted again. when a reception operation, busy control, and strobe control are not performed, the p20/si1, p23/ stb, and p24/busy pins can be used as normal i/o ports. the repeat transmission mode operation timing is shown in figure 14-14, and the operation flowchart in figure 14-15. the operation of the buffer ram to transmit 6-byte data in repeat transmission mode is shown in figure 14-16. figure 14-14. repeat transmission mode operation timing caution since, in the repeat transmission mode, a read is performed on the buffer ram after the transmission of one byte, the interval is included in the period up to the next transmission. as the buffer ram read is performed at the same time as cpu processing, the maximum interval is dependent upon the cpu operation and the value of the automatic data transmit/receive interval specification register (adti) (see (5) automatic transmit/receive interval). d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 interval interval d7 d6 d5 sck1 so1
chapter 14 serial interface channel 1 288 user s manual u11302ej4v0um figure 14-15. repeat transmission mode flowchart adtp: automatic data transmit/receive address pointer adti: automatic data transmit/receive interval specification register sio1: serial i/o shift register 1 start write transmit data in buffer ram set adtp to the value (pointer value) obtained by subtracting 1 from the number of transmit data bytes set the transmission/reception operation interval time in adti write any data to sio1 (start trigger) write transmit data from buffer ram to sio1 transmission operation pointer value = 0 no yes decrement pointer value software execution hardware execution reset adtp
chapter 14 serial interface channel 1 289 user s manual u11302ej4v0um when data of 6 bytes are transmitted in repeat transmission mode (arld = 1, re = 0), the buffer ram operates as follows. (i) before transmission (refer to figure 14-16 (a) ) after arbitrary data has been written to serial i/o shift register 1 (sio1) (start trigger: this data is not transferred), transmit data 1 (t1) is transferred from the buffer ram to sio1. when transmission of the first byte is completed, the automatic data transmit/receive address pointer (adtp) is decremented. then transmit data 2 (t2) is transferred from the buffer ram to sio1. (ii) upon completion of transmission of 6 bytes (refer to figure 14-16 (b) ) when transmission of the sixth byte is completed, the interrupt request flag (csiif1) is not set. the first pointer value is set again to adtp. (iii) 7th byte transmission point (refer to figure 14-16 (c) ) transmit data 1 (t1) is transferred from the buffer ram to sio1 again. when transmission of the first byte is completed, adtp is decremented. then transmit data 2 (t2) is transferred from the buffer ram to sio1. figure 14-16. buffer ram operation in 6-byte transmission (in repeat transmission mode) (1/2) (a) before transmission transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 0 csiif1 5 adtp 1
chapter 14 serial interface channel 1 290 user s manual u11302ej4v0um figure 14-16. buffer ram operation in 6-byte transmission (in repeat transmission mode) (2/2) (b) upon completion of transmission of 6 bytes (c) 7th byte transmission point transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 0 csiif1 0 adtp transmit data 1 (t1) transmit data 2 (t2) transmit data 3 (t3) transmit data 4 (t4) transmit data 5 (t5) transmit data 6 (t6) faffh fac5h fac0h sio1 0 csiif1 5 adtp 1
chapter 14 serial interface channel 1 291 user s manual u11302ej4v0um (d) automatic transmission/reception suspension and restart automatic transmission/reception can be temporarily suspended by resetting bit 7 (csie1) of serial operating mode register 1 (csim1) to 0. if 8-bit data transfer is in progress, the transmission/reception is not suspended if bit 7 (csie1) is reset to 0. it is suspended upon completion of 8-bit data transfer. when suspended, bit 3 (trf) of the automatic data transmit/receive control register (adtc) is set to 0 after transfer of the 8th bit, and all the port pins used alternately as serial interface pins (p20/ si1, p21/so1, p22/sck1, p23/stb, and p24/busy) are set to the port mode. to resume automatic transmission/reception, set csie1 to 1 and write any value to serial i/o shift register 1 (sio1). this enables transmission of the remaining data. cautions 1. if the halt instruction is executed during automatic transmission/reception, transfer is suspended and the halt mode is set even during 8-bit data transfer. when the halt mode is cleared, automatic transmission/reception is restarted at the suspended point. 2. when suspending automatic transmission/reception, do not change the operating mode to 3-wire serial i/o mode while trf = 1. figure 14-17. automatic transmission/reception suspension and restart csie1: bit 7 of serial operating mode register 1 (csim1) sck1 so1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 si1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 restart command csie1 = 1, write to sio1 suspend csie1 = 0 (suspend command)
chapter 14 serial interface channel 1 292 user s manual u11302ej4v0um (4) synchronization control busy control and strobe control are used to synchronize transmission/reception data between the master device and slave device. by using these functions, a bit slippage in data being transmitted/received can be detected. (a) busy control option busy control is used to allow a slave device to output a busy signal to the master device, so that the master device puts serial transmission/reception into a wait state while the busy signal is active. to use the busy control option, the following conditions must be satisfied. set bit 5 (ate) of serial operating mode register 1 (csim1) to 1. set bit 1 (busy1) of the automatic data transmit/receive control register (adtc) to 1. figure 14-18 shows the system configuration of the master device and a slave device when the busy control option is used. figure 14-18. system configuration with busy control option sck1 so1 si1 sck1 so1 si1 busy master device ( pd780208 subseries) slave device the master device inputs the busy signal output by the slave device to the busy/p24 pin. it samples the input busy signal in synchronization with the fall of the serial clock. even if the busy signal becomes active while 8-bit data is being transmitted or received, transmission/reception is not put into a wait state. if the busy signal is active at the rising edge of the serial clock two clocks after transmission or reception of 8-bit data has been completed, the busy signal becomes valid. after that, transmission or reception is put into a wait state while the busy signal is active. the active level of the busy signal is specified by bit 0 (busy0) of adtc, as follows. busy0 = 0: active high busy0 = 1: active low when using the busy control option, select the internal clock as the serial clock. busy control cannot be executed with an external clock. figure 14-19 shows the operation timing when using the busy control option. caution busy control cannot be executed when the interval time is controlled by using the automatic data transmit/receive interval specification register (adti). if an attempt is made to execute both control operations at the same time, busy control is invalid.
chapter 14 serial interface channel 1 293 user s manual u11302ej4v0um figure 14-19. operation timing when using busy control option (busy0 = 0) sck1 d7 so1 si1 csiif1 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 busy trf busy input clear busy input valid wait caution when trf is cleared, the so1 pin becomes low level. remark csiif1: interrupt request flag trf: bit 3 of the automatic data transmit/receive control register (adtc) when the busy signal becomes inactive, the wait is cleared. if the sampled busy signal is inactive, transmission/reception of the next 8-bit data is started at the falling edge of the next serial clock. note that, because the busy signal is asynchronous to the serial clock, it takes the master device up to 1 clock to sample the busy signal even if the slave device has made the busy signal inactive. in addition, it takes 0.5 clock until data transfer is started after the signal has been sampled. to clear the wait, therefore, it is necessary for the slave device to keep the busy signal inactive for at least 1.5 clocks. figure 14-20 shows the timing of the busy signal and wait clearance. in figure 14-20, the busy signal becomes active as soon as transmission/reception has started. figure 14-20. busy signal and clearing wait (busy0 = 0) sck1 d7 so1 si1 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 busy (active high) 1.5 clocks (min.) busy input clear busy input valid wait if busy signal becomes inactive immediately after it has been sampled.
chapter 14 serial interface channel 1 294 user s manual u11302ej4v0um (b) busy & strobe control option strobe control is used to synchronize data transmission/reception between the master device and a slave device. the master device outputs a strobe signal from the stb/p23 pin on completion of transmission/reception of 8-bit data. this strobe signal informs the slave device of the data transmission/reception completion timing of the master device. therefore, synchronization can be established even if bit slippage occurs due to noise carried on the serial clock, keeping bit slippage from affecting transmission of the next byte. to use the strobe control option, the following conditions must be satisfied. set bit 5 (ate) of serial operating mode register 1 (csim1) to 1. set bit 2 (strb) of the automatic data transmit/receive control register (adtc) to 1. usually, the busy control and strobe control options are simultaneously used for handshaking. in this case, the strobe signal is output from the stb/p23 pin and the busy/p24 pin is sampled. while a busy signal is being input to the pin, transmission/reception can be put into a wait state. if strobe control is not executed, the p23/stb pin can be used as a normal i/o port pin. figure 14-21 shows the operation timing when using the busy & strobe control option. when the strobe control option is used, the interrupt request flag (csiif1) that is set on completion of transmission/reception is set after the strobe signal has been output. figure 14-21. operation timing when using busy & strobe control option (busy0 = 0) stb sck1 d7 so1 si1 csiif1 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 busy trf busy input clear busy input valid caution when trf is cleared, the so1 pin becomes low level. remark csiif1: interrupt request flag trf: bit 3 of the automatic data transmit/receive control register (adtc)
chapter 14 serial interface channel 1 295 user? manual u11302ej4v0um (c) bit slippage detection function with busy signal during automatic transmission/reception, bit slippage may take place in the serial clock of the slave device due to the noise carried on the serial clock signal output by the master device. unless the strobe control option is used at this time, the bit slippage affects transmission of the next byte. in such a case, the master device can detect the bit slippage by using the busy control option and checking the busy signal during transmission. the bit slippage is detected by using the busy signal as follows. the slave outputs a busy signal after the 8th rise of the serial clock during data transmission/reception (at this time, make the busy signal inactive within two clocks to stop the master device putting transmission/reception into a wait state). the master samples the busy signal in synchronization with the fall of the serial clock. if bit slippage does not occur, the busy signal is found to be inactive after it has been sampled eight times. if the busy signal is found to be active when it has been sampled, it is assumed that bit slippage has occurred, and error processing is performed (by setting bit 4 (err) of the automatic data transmit/ receive control register (adtc) to 1). figure 14-22 shows the operation timing of the bit slippage detection function using the busy signal. figure 14-22. operation timing of bit slippage detection function using busy signal (busy0 = 1) sck1 d7 so1 si1 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 busy csiif1 csie1 err d7 d7 no busy detection error interrupt request generation error detection bit slippage due to noise (slave side) sck1 (master side) csiif1: interrupt request flag csie1: bit 7 of serial operating mode register 1 (csim1) err: bit 4 of the automatic data transmit/receive control register (adtc)
chapter 14 serial interface channel 1 296 user s manual u11302ej4v0um (5) automatic transmit/receive interval when the automatic transmit/receive function is used, one byte is transmitted/received and then the buffer ram is read/written; therefore an interval is inserted before the next transmission/reception. when the automatic transmit/receive function is performed using an internal clock, since the read/write operations from/to the buffer ram are done in parallel with cpu processing, the interval depends on the cpu processing at the timing of the serial clock s eighth rising-edge and the value set in the automatic data transmit/receive interval specification register (adti). whether or not the interval depends on adti can be selected by setting bit 7 (adti7) of adti. when adti7 is set to 0, the interval depends only on the cpu processing. when adti7 is set to 1, the interval is the value determined by the contents of adti or other value determined by cpu processing, whichever is greater. when the automatic transmit/receive function is performed using an external clock, the clock must be selected so that the interval is longer than the value shown in (b). figure 14-23. automatic transmit/receive interval csiif1: interrupt request flag sck1 so1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 csiif1 si1 d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0 interval
chapter 14 serial interface channel 1 297 user s manual u11302ej4v0um (a) when automatic transmit/receive function is performed using an internal clock the internal clock operation is selected when bit 1 (csim11) of serial operating mode register 1 (csim1) is set to 1. in this case, the interval is determined as follows by cpu processing. when bit 7 (adti7) of the automatic data transmit/receive interval specification register (adti) is set to 0, the interval is determined by cpu processing. when adti7 is set to 1, the interval is determined by the contents of adti or by cpu processing, whichever is greater. for the interval determined by adti, see figure 14-5 format of automatic data transmit/receive interval specification register . table 14-3. interval determined by cpu processing (with internal clock operation) cpu processing interval when using multiplication instruction max. (2.5t sck , 13t cpu ) when using division instruction max. (2.5t sck , 20t cpu ) external access 1-wait mode max. (2.5t sck , 9t cpu ) other than above max. (2.5t sck , 7t cpu ) t sck : 1/f sck f sck : serial clock frequency t cpu : 1/f cpu f cpu : cpu clock (set by bits 0 to 2 (pcc0 to pcc2) of the processor clock control register (pcc)) max. (a, b) : a or b, whichever is greater figure 14-24. operation timing when automatic transmit/receive function is operating with internal clock f x : main system clock oscillation frequency f cpu : cpu clock (set by bits 0 to 2 (pcc0 to pcc2) of the processor clock control register (pcc)) t cpu : 1/f cpu t sck : 1/f sck f sck : serial clock frequency f x f cpu (n = 1) sck1 so1 si1 t cpu t sck interval d7 d6 d5 d4 d3 d2 d1 d0 d7 d6 d5 d4 d3 d2 d1 d0
chapter 14 serial interface channel 1 298 user s manual u11302ej4v0um (b) when automatic transmit/receive function is performed using an external clock the external clock operation is selected when bit 1 (csim11) of serial operating mode register 1 (csim1) is cleared to 0. when the automatic transmit/receive function is performed using an external clock, the clock must be selected so that the interval is longer than the values shown below. table 14-4. interval determined by cpu processing (with external clock operation) cpu processing interval when using multiplication instruction 13t cpu or more when using division instruction 20t cpu or more external access 1-wait mode 9t cpu or more other than above 7t cpu or more t cpu : 1/f cpu f cpu : cpu clock (set by bits 0 to 2 (pcc0 to pcc2) of the processor clock control register (pcc))
299 user? manual u11302ej4v0um chapter 15 vfd controller/driver 15.1 vfd controller/driver functions the functions of the vfd controller/driver incorporated in the pd780208 subseries are as follows. (1) automatically outputs the segment signals (dma operation) and digit signals by automatically reading data displayed. (2) controls 9- to 40-segment and 2- to 16-digit vfds (vacuum fluorescent display) using display mode registers 0, 1, and 2 (dspm0 to dspm2). (3) digit signal output timing can be specified freely by selecting display mode 2 using display mode register 0 (dspm0). (4) pins not used for vfd display can be used as output and i/o ports (but fip0 to fip12 are display output- only pins). (5) luminance can be adjusted in 8 levels using display mode register 1 (dspm1). (6) incorporates hardware for key scan application. generates interrupt signal (intks) indicating key scan timing. outputs key scan signals from segment output pins by setting key scan data to port 8 through port 12. detects timing at which key scan data are output by the key scan flag (ksf). (7) incorporates a high-withstanding-voltage output buffer that can directly drive the vfd. (8) the display output pins can be connected to on-chip pull-down resistors by mask option. cautions 1. this cannot be used with the subsystem clock. to stop the main oscillation, stop the display in advance by setting bits 4 to 7 (digs0 to digs3) of display mode register 1 (dspm1) to 0000. 2. set ports 8 through 12 to 0 and output latches to 0 before doing the following: using the vfd controller/driver stopping display
chapter 15 vfd controller/driver 300 user? manual u11302ej4v0um figure 15-1. vfd controller operation timing in display mode 1 (dspm05 = 0) dspm05: bit 5 of display mode register 0 (dspm0) n: displayed digits ?1 (digits 2 to 16 can be selected using display mode register 1 (dspm1)) t dsp : 1 display cycle (1024/f x (204.8 s: @ 5.0 mhz operation) or 2048/f x (409.6 s: @ 5.0 mhz operation)) t ks : key scan timing (t ks = t dsp ) t cyt : display cycle (t cyt = t dsp x (displayed digits + 1)) t dig : pulse width of digit signal (can be selected from 8 types using dspm1) note the user can select the cut width of the segment signals by setting bits 1 to 3 (dims1 to dims3) of dspm1. therefore, actual output waveforms may be different from the above illustration and have the cut widths shown in figure 15-6. remark if dspm05 is set to 1, digit signals are output according to the values set in the display ram. segment signal note key scan flag (ksf) can be changed whenever necessary fipn fip2 fip1 digit signal fip0 . . . . . . . . . . . . t dsp t cyt t ks t dig 1 display cycle key scan timing
chapter 15 vfd controller/driver 301 user s manual u11302ej4v0um there are 53 display output pins. of these, 40 pins, fip13 to fip52, have alternate port functions. these pins are used as port pins when display stop is set using bits 4 to 7 (digs0 to digs3) of display mode register 1 (dspm1). even when display is enabled, display output pins not used for outputting digit signals and segment signals can be used as port pins. table 15-1. relationship between display output pins and port pins display pin name alternate port name i/o fip13 p80 for output port to to fip20 p87 fip21 p90 for output port to to fip28 p97 fip29 p100 i/o port to to fip36 p107 fip37 p110 i/o port to to fip44 p117 fip45 p120 i/o port to to fip52 p127 15.2 vfd controller/driver configuration the vfd controller/driver consists of the following hardware. table 15-2. vfd controller/driver configuration item configuration display output 53 pins (segments: 9 to 40, digits: 2 to 16) control registers display mode register 0 (dspm0) display mode register 1 (dspm1) display mode register 2 (dspm2)
chapter 15 vfd controller/driver 302 user? manual u11302ej4v0um figure 15-2. vfd controller/driver block diagram internal bus display mode register 2 (dspm2) display mode register 1 (dspm1) display mode register 0 (dspm0) 00 useg5 useg4 useg3 useg2 useg1 useg0 digs3 digs2 digs1 digs0 dims3 dims2 dims1 dims0 ksf dspm06 dspm05 segs4 segs3 segs2 segs1 segs0 543 5 display data memory write mask controller display timing selector digit signal generator blanking signal generator display cycle display data selector display data latch port output latch high-withstanding-voltage output buffer fip13/p80 fip52/p127 fip0
chapter 15 vfd controller/driver 303 user s manual u11302ej4v0um 15.3 vfd controller/driver control registers 15.3.1 control registers there are three registers for controlling the vfd controller/driver. display mode register 0 (dspm0) display mode register 1 (dspm1) display mode register 2 (dspm2) (1) display mode register 0 (dspm0) (see figure 15-3) this register sets the following and displays the display timing/key scan state. display mode display segment number/display output total number mode for subsystem clock noise eliminator dspm0 is set with an 8-bit memory manipulation instruction. however, only bit 7 (ksf) can be read with a 1-bit memory manipulation instruction. reset input sets dspm0 to 00h. (2) display mode register 1 (dspm1) (see figure 15-4) this register sets the following. display digit number/display pattern number cut width of the vfd output signal display cycle (t dsp ) when bit 0 (dims0) is set to 1 and the display cycle to 2048/f x (409.6 s: @ 5.0 mhz operation), light leakage is reduced. as the display cycle approaches the commercial power supply frequency when the display digits are increased, the display will flicker. in this case, select 1024/f x (204.8 s: @ 5.0 mhz operation). if light leaks, adjust the cut width of the digit signal using bits 1 to 3 (dims1 to dims3). dspm1 is set with an 8-bit memory manipulation instruction. reset input sets dspm1 to 00h.
chapter 15 vfd controller/driver 304 user s manual u11302ej4v0um (3) display mode register 2 (dspm2) (see figure 15-5) dspm2 is the register that holds the number of mask bits in the display data storage area when display mode 2 (dspm05 = 1) is selected by display mode register 0 (dspm0). by using this register to mask the part of the display data that does not need to be rewritten, the software workload is reduced. mask bits are assigned from s0 (= the least significant bit of the lowest address in the display output area defined by bits 0 to 4 of dspm0). dspm2 is set with an 8-bit memory manipulation instruction. reset input sets dspm2 to 00h. the following illustration shows the status of the display data memory when the number of segments is 32 and the number of mask bits is 11. s31 s24 s23 bit 7 0 7 s16 s15 07 07 0 s8 s7 s0 11 bits ....................... ................... .................... .................... fa50h fa40h : the shaded part shows the area in which display data is rewritable during display : the slashed part shows the area in which display data is not rewritable during display (display data are fixed) fa70h fa60h caution the number of mask bits specified must be below the total number of display outputs defined by display mode register 0 (dspm0).
chapter 15 vfd controller/driver 305 user s manual u11302ej4v0um figure 15-3. format of display mode register 0 (1/2) r/w segs4 segs3 segs2 segs1 segs0 display segment (display mode 1) display output total (display mode 2) 000009 9 0000110 10 0001011 11 0001112 12 0010013 13 0010114 14 0011015 15 0011116 16 0100017 17 0100118 18 0101019 19 0101120 20 0110021 21 0110122 22 0111023 23 0111124 24 1000025 25 1000126 26 1001027 27 1001128 28 1010029 29 1010130 30 1011031 31 1011132 32 1100033 33 1100134 34 1101035 35 1101136 36 1110037 37 1110138 note 38 1111039 note 39 1111140 note 40 note when the total number of digits and segments together exceeds 53, the digits have priority. 710 65432 ksf segs1 segs0 dspm06 dspm05 segs4 segs3 segs2 symbol dspm0 f f a 0 h 0 0 h r/w address after reset r/w
chapter 15 vfd controller/driver 306 user s manual u11302ej4v0um figure 15-3. format of display mode register 0 (2/2) r/w dspm05 display mode setting 0 display mode 1 (segment/character type) 1 display mode 2 (type in which a segment spans over two or more grids.) r/w dspm06 subsystem clock noise eliminator mode setting note 2 0 2.5 mhz < f x 5.0 mhz 1 1.25 mhz f x 2.5 mhz note 3 r ksf timing state 0 display timing 1 key scan timing notes 1. bit 7 (ksf) is a read-only bit. 2. set the values according to the main system clock oscillation frequency (f x ) used. the noise eliminator is enabled during vfd display operations. 3. if f x selected is between 1.25 mhz and 2.5 mhz, set dspm06 to 1 prior to vfd display. caution when a main system clock frequency below 1.25 mhz is selected and the vfd controller/ driver is used, make sure to use the main system clock for watch timer counting by setting tcl24 to 0. 710 65432 ksf segs1 segs0 dspm06 dspm05 segs4 segs3 segs2 symbol dspm0 f f a 0 h 0 0 h r/w note 1 address after reset r/w
chapter 15 vfd controller/driver 307 user s manual u11302ej4v0um figure 15-4. format of display mode register 1 dims0 display mode cycle setting 0 1024/f x is 1 display cycle. (1 display cycle = 204.8 s: when operated at 5.0 mhz) 1 2048/f x is 1 display cycle. (1 display cycle = 409.6 s: when operated at 5.0 mhz) dims3 dims2 dims1 vfd output signal cut width 0 0 0 1/16 0 0 1 2/16 0 1 0 4/16 0 1 1 6/16 1 0 0 8/16 1 0 1 10/16 1 1 0 12/16 1 1 1 14/16 digs3 digs2 digs1 digs0 display digit (display mode 1) dspm05 = 0 display pattern (display mode 2) dspm05 = 1 0000 display stopped (static display) note display stopped (static display) note 00012 digits 2 patterns 00103 digits 3 patterns 00114 digits 4 patterns 01005 digits 5 patterns 01016 digits 6 patterns 01107 digits 7 patterns 01118 digits 8 patterns 10009 digits 9 patterns 100110 digits 10 patterns 101011 digits 11 patterns 101112 digits 12 patterns 110013 digits 13 patterns 110114 digits 14 patterns 111015 digits 15 patterns 111116 digits 16 patterns note static display is possible when display stop is selected, by manipulating the port output latch. remark f x : main system clock oscillation frequency dspm05: bit 5 of display mode register 0 (dspm0) 710 65432 digs3 dims1 dims0 digs2 digs1 digs0 dims3 dims2 symbol dspm1 f f a 1 h 0 0 h r/w address after reset r/w
chapter 15 vfd controller/driver 308 user s manual u11302ej4v0um figure 15-5. format of display mode register 2 (1/2) useg5 useg4 useg3 useg2 useg1 useg0 number of mask bits to be written 000000 none 0000011 0000102 0000113 0001004 0001015 0001106 0001117 0010008 0010019 00101010 00101111 00110012 00110113 00111014 00111115 01000016 01000117 01001018 01001119 01010020 01010121 01011022 01011123 01100024 01100125 01101026 01101127 01110028 01110129 01111030 01111131 710 65432 0 useg1 useg0 0 useg5 useg4 useg3 useg2 symbol dspm2 f f a 2 h 0 0 h r/w address after reset r/w
chapter 15 vfd controller/driver 309 user s manual u11302ej4v0um figure 15-5. format of display mode register 2 (2/2) useg5 useg4 useg3 useg2 useg1 useg0 number of mask bits to be written 10000032 10000133 10001034 10001135 10010036 10010137 10011038 10011139 other than the above setting prohibited 710 65432 0 useg1 useg0 0 useg5 useg4 useg3 useg2 symbol dspm2 f f a 2 h 0 0 h r/w address after reset r/w
chapter 15 vfd controller/driver 310 user s manual u11302ej4v0um 15.3.2 one-display period and cut width the digit signal is equally cut at the beginning and end of the display period by the cut width set by bits 1 to 3 (dims1 to dims3) of display mode register 1 (dspm1). figure 15-6. cut width of segment/digit signal 0 is output for the first one-display cycle when display is started from the display stop status. figure 15-7. vfd controller display start timing n: displayed digits 1 (digits 2 to 16 can be selected using display mode register 1 (dspm1)) t dsp : 1 display cycle (1024/f x (204.8 s: @ 5.0 mhz operation) or 2048/f x (409.6 s: @ 5.0 mhz operation)) t ks : key scan timing (t ks = t dsp ) t dig : pulse width of digit signal (can be selected from 8 types using dspm1) note the user can select the cut width of the segment signals by setting bits 1 to 3 (dims1 to dims3) of dspm1. therefore, actual output waveforms may be different from the above illustration and have the cut widths shown in figure 15-6. 1 display cycle = t dsp segment signal digit signal (1/16 of cut width) segment signal digit signal (2/16 of cut width) segment signal digit signal (4/16 of cut width) 1/16 1/16 1/8 1/8 1/4 1/4 segment signal note key scan flag (ksf) can be changed whenever necessary fipn fip2 fip1 digit signal fip0 t dsp t ks t dig 1 display cycle key scan timing displaying starts
chapter 15 vfd controller/driver 311 user s manual u11302ej4v0um 15.4 selecting display mode the number of segments and digits displayed by the vfd controller/driver depends on the display mode set. figure 15-8. selection of display mode number of digits selected 9 2345678 01014 11 12 13 15 16 number of segments selected 0 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 36 37 38 39 40 caution when the total number of digits and segments together exceeds 53, the digits have priority.
chapter 15 vfd controller/driver 312 user s manual u11302ej4v0um 15.5 display mode and display output the on-chip vfd controller/driver assigns pins fip0 to fip52/p127 to digit signals and segment signals (in this order). the number assigned is specified by display mode registers 0 and 1 (dspm0 and dspm1). the remaining pins are assigned as general-purpose ports. the pin configuration for a 14-segment display is shown below as an example. figure 15-9. pin configuration for 14-segment display remark t0 to t15: display digit pins s0 to s13: segment pins ............... pin name number of display digits selected display stop fip0 fip1 fip2 fip3 fip4 fip5 fip6 fip7 fip8 fip9 fip10 fip11 fip12 fip13/p80 fip14/p81 fip15/p82 fip16/p83 fip17/p84 fip18/p85 fip19/p86 fip20/p87 fip21/p90 fip22/p91 fip23/p92 fip24/p93 fip25/p94 fip26/p95 fip27/p96 fip28/p97 fip29/p100 fip30/p101 fip31/p102 fip51/p126 fip52/p127 fip0 fip1 fip2 fip3 fip4 fip5 fip6 fip7 fip8 fip9 fip10 fip11 fip12 p80 p81 p82 p83 p84 p85 p86 p87 p90 p91 p92 p93 p94 p95 p96 p97 p100 p101 p102 p126 p127 2 3 4 14 15 16 t0 t1 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p83 p84 p85 p86 p87 p90 p91 p92 p93 p94 p95 p96 p97 p100 p101 p102 p126 p127 t0 t1 t2 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p84 p85 p86 p87 p90 p91 p92 p93 p94 p95 p96 p97 p100 p101 p102 p126 p127 t0 t1 t2 t3 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p85 p86 p87 p90 p91 p92 p93 p94 p95 p96 p97 p100 p101 p102 p126 p127 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p97 p100 p101 p102 p126 p127 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p100 p101 p102 p126 p127 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 p101 p102 p126 p127 ...............
chapter 15 vfd controller/driver 313 user s manual u11302ej4v0um 15.6 display data memory the display data memory is the area for storing the segment data to be displayed. this memory is mapped at addresses fa30h to fa7fh. to display data on the vfd, the vfd controller reads the data stored in this memory regardless of the type of operations performed by the cpu (dma operations). the area not used for the display data can be used as normal ram area. at the key scan timing (t ks ), all segment outputs and digit outputs become 0 and the output latch data of ports 8, 9, 10, 11, and 12 are output to fip37/p110 to fip52/p127. figure 15-10. relationship between display data memory contents and segment output bit 7 0 7 0 7 0 7 0 7 0 display data memory timing output s39 s32 s31 s24 s23 s16 s15 s8 s7 s0 fa70h fa71h fa72h fa73h fa74h fa75h fa76h fa77h fa78h fa79h fa7ah fa7bh fa7ch fa7dh fa7eh fa7fh fa60h fa61h fa62h fa63h fa64h fa65h fa66h fa67h fa68h fa69h fa6ah fa6bh fa6ch fa6dh fa6eh fa6fh fa50h fa51h fa52h fa53h fa54h fa55h fa56h fa57h fa58h fa59h fa5ah fa5bh fa5ch fa5dh fa5eh fa5fh fa40h fa41h fa42h fa43h fa44h fa45h fa46h fa47h fa48h fa49h fa4ah fa4bh fa4ch fa4dh fa4eh fa4fh fa30h fa31h fa32h fa33h fa34h fa35h fa36h fa37h fa38h fa39h fa3ah fa3bh fa3ch fa3dh fa3eh fa3fh t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t ks 0000000000000000000000000000000000000000
chapter 15 vfd controller/driver 314 user s manual u11302ej4v0um 15.7 key scan flag and key scan data 15.7.1 key scan flag the key scan flag (ksf) is set to 1 during the key scan timing and reset automatically to 0 during the display timing. ksf is mapped at bit 7 of display mode register 0 (dspm0) and can be tested one bit at a time. it cannot be written. by testing the ksf, it can be determined if it is during the key scan timing and if the data input using keys is correct. 15.7.2 key scan data the data stored in ports 8, 9, 10, 11, and 12 are output from pins fip13 to fip52 at the key scan timing. by changing the data output from ports 11 and 12 during the key scan timing, key scan can be performed using these pins fip13 to fip52. caution if, during the key scan timing, scanning is performed which causes both the segment and digit lines to turn on at the same time, the display may be disturbed.
chapter 15 vfd controller/driver 315 user s manual u11302ej4v0um 15.8 light leakage of vfd light may leak when a vfd is driven using the pd780208 subseries. two possible causes are as follows. (1) light leakage due to a short blanking time figure 15-11 shows the signal waveforms when only the first digit of two digits to be displayed is lit. as shown in this figure, when the blanking time is short, the t1 signal rises before the segment signal disappears, resulting in light leakage. generally, as approximately 20 s is required for the blanking time, consider the values set to display mode register 1 (dspm1) carefully. figure 15-11. light leakage due to short blanking time (2) light leakage due to capacitance between segment and grid of vfd as shown in figure 15-13, light may leak even if the blanking time is sufficient. as shown by c sg in figure 15-12, as there is capacitance between the grid and segment of the vfd, the timing signal pin voltage will be increased via c sg when the segment signal turns on. as shown in figure 15-13, when this voltage exceeds the cut-off voltage (e k ), light will leak. this spike noise voltage depends on the size of c sg and the on-chip pull-down resistor (r l ). the greater the value of c sg or the r l value, the greater the voltage, making it easy for light to leak. this c sg value differs according to the area of the data displayed on the vfd. the greater the area, the greater c sg . consequently, pull-down resistor values with which light will not leak also depend on the size of the vfd. as the value of the pull-down resistor incorporated by the mask option is comparatively great, in some cases, light leakage cannot be controlled with resistance only. if the quality of the display is insufficient, increase the back bias (increase the e k ), place a filter over the vfd, or attach a 10 k ? pull-down resistor externally to the timing signal pin. t0 blanking time t1 s0 light leakage
chapter 15 vfd controller/driver 316 user s manual u11302ej4v0um depending on the duty cycle of the spike noise voltage for the whole display period, the ease with which light leaks due to c sg varies. the fewer the number of digits displayed, the easier it is for light to leak. lowering the luminance of the display is also effective. figure 15-12. light leakage due to c sg e k : cut-off voltage r l : on-chip pull-down resistor figure 15-13. waveform of light leakage due to c sg pd780205 _ 30 v v load + 5 v v dd s0 _ t0 _ c sg fip segment grid filament r l r l e k t0 t1 s0 e k
chapter 15 vfd controller/driver 317 user? manual u11302ej4v0um 15.9 display examples the pd780208 subseries has a vfd controller/driver that enables the following three types of vfd display. display types can be switched by setting bit 5 (dspm05) of display mode register 0 (dspm0). segment type (display mode 1: dspm05 = 0) dot type (display mode 1: dspm05 = 0) display type in which a segment spans two or more grids (display mode 2: dspm05 = 1) the following figures show vfd display examples for each display type. (1) segment type: 10 segments x 11 digits (2) dot type: 35 segments x 16 digits (3) display type in which a segment spans two or more grids: 23 segments x 7 patterns sun 1 0 am pm i j mon 2 tue 3 wed 4 thu 5 j j fri 6 sat 78910 d g a e f c b h i heating middle slow temp open preheat end timer kcal g c 2a 2g 2d 2f 2b 2e 2c 1a 1f 1e 1c o 2a 2g 2d 2f 2b 2e 2c 1a 1f 1b 1e 1c n p o m 5g 4g 3g 2g 1g 1d 1g 1d r 2 1g 300 250 200 150 100 q p n hi j h i r 3 r 4 r 5 r 6 r 7 r 8 r 9 r10 r11 r12 r13 r14 1b kl m kl j start keep warm fast defrost
chapter 15 vfd controller/driver 318 user s manual u11302ej4v0um 15.9.1 segment type (display mode 1: dspm05 = 0) figure 15-14 shows the display data memory configuration and data reading order when the device controls a 10-segment x 11-digit vfd display. as segment type (display mode 1) is selected, the display data memory stores segment data. figure 15-14. display data memory configuration and segment data reading order (segment type) bit 7 0 7 0 7 0 7 0 7 0 display data memory s9 fa60h fa61h fa62h fa63h fa64h fa65h fa66h fa67h fa68h fa69h fa6ah fa6bh fa6ch fa6dh fa6eh fa6fh fa50h fa51h fa52h fa53h fa54h fa55h fa56h fa57h fa58h fa59h fa5ah fa5bh fa5ch fa5dh fa5eh fa5fh fa40h fa41h fa42h fa43h fa44h fa45h fa46h fa47h fa48h fa49h fa4ah fa4bh fa4ch fa4dh fa4eh fa4fh fa30h fa31h fa32h fa33h fa34h fa35h fa36h fa37h fa38h fa39h fa3ah fa3bh fa3ch fa3dh fa3eh fa3fh t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t ks t11 t12 t13 t14 t15 s0 fa70h <1> <2> fa71h <3> fa72h fa73h fa74h fa75h fa76h fa77h fa78h fa79h fa7ah fa7bh fa7ch fa7dh fa7eh fa7fh remarks 1. <1> through <3> show the segment data reading order. 2. the shaded area shows the segment data storage area. in the case of example (1) in 15.9 , the contents of the data memory indicated by shading are as shown in figure 15-15.
chapter 15 vfd controller/driver 319 user s manual u11302ej4v0um figure 15-15. relationship between display data memory contents and segment outputs in 10-segment x 11-digit display mode 2345678910 1 0 mon tue wed thu fri sat sun am pm f e g d a b c h i j i j j 0 0 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 fa70h fa60h fa71h fa61h fa72h fa62h fa73h fa63h fa74h fa64h fa75h fa65h fa76h fa66h fa77h fa67h fa78h fa68h fa79h fa69h fa7ah fa6ah bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 fa7 h fa6 h t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 j i h g f e d c b a display data memory
chapter 15 vfd controller/driver 320 user s manual u11302ej4v0um 15.9.2 dot type (display mode 1: dspm05 = 0) figure 15-16 shows the display data memory configuration and data reading order when the device controls a 35-segment (5 x 7 dots) x 16-digit vfd display. as dot type (display mode 1) is selected, the display data memory stores segment data. figure 15-16. display data memory configuration and segment data reading order (dot type) bit 7 0 7 0 7 0 7 0 7 0 display data memory s34 s0 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t ks fa70h <1> fa71h <6> fa72h fa73h fa74h fa75h fa76h fa77h fa78h fa79h fa7ah fa7bh fa7ch fa7dh fa7eh fa7fh fa60h <2> fa61h fa62h fa63h fa64h fa65h fa66h fa67h fa68h fa69h fa6ah fa6bh fa6ch fa6dh fa6eh fa6fh fa50h <3> fa51h fa52h fa53h fa54h fa55h fa56h fa57h fa58h fa59h fa5ah fa5bh fa5ch fa5dh fa5eh fa5fh fa40h <4> fa41h fa42h fa43h fa44h fa45h fa46h fa47h fa48h fa49h fa4ah fa4bh fa4ch fa4dh fa4eh fa4fh fa30h fa31h fa32h fa33h fa34h fa35h fa36h fa37h fa38h fa39h fa3ah fa3bh fa3ch fa3dh fa3eh fa3fh <5> remarks 1. <1> through <6> show the segment data reading order. 2. the shaded area shows the segment data storage area. in the case of example (2) in 15.9 , the contents of the data memory indicated by shading are as shown in figure 15-17.
chapter 15 vfd controller/driver 321 user s manual u11302ej4v0um figure 15-17. relationship between display data memory contents and segment outputs in 35-segment x 16-digit display mode fa7fh fa6fh fa5fh fa4fh fa3fh fa7eh fa6eh fa5eh fa4eh fa3eh fa7dh fa6dh fa5dh fa4dh fa3dh fa7ch fa6ch fa5ch fa4ch fa3ch fa7bh fa6bh fa5bh fa4bh fa3bh fa7ah fa6ah fa5ah fa4ah fa3ah fa79h fa69h fa59h fa49h fa39h fa78h fa68h fa58h fa48h fa38h fa77h fa67h fa57h fa47h fa37h fa76h fa66h fa56h fa46h fa36h fa75h fa65h fa55h fa45h fa35h fa74h fa64h fa54h fa44h fa34h fa73h fa63h fa53h fa43h fa33h fa72h fa62h fa52h fa42h fa32h fa71h fa61h fa51h fa41h fa31h fa70h fa60h fa50h fa40h fa30h 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 fa7 h fa6 h fa5 h fa4 h fa3 h t15 t14 t13 t12 t11 t10 t9 t8 t7 t6 t5 t4 t3 t2 t1 t0 s34 s33 s32 s31 s30 s29 s28 s27 s26 s25 s24 s23 s22 s21 s20 s19 s18 s17 s16 s15 s14 s13 s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 s0 to s34 s0 s5 s10 s15 s20 s25 s30 s1 s6 s11 s16 s21 s26 s31 s2 s7 s12 s17 s22 s27 s32 s3 s8 s13 s18 s23 s28 s33 s4 s9 s14 s19 s24 s29 s34 display data memory
chapter 15 vfd controller/driver 322 user? manual u11302ej4v0um 15.9.3 display type in which a segment spans two or more grids (display mode 2: dspm05 = 1) in display mode 2, all of the display output data are stored in the display data memory. figure 15-18 shows the display data ram configuration and data reading order in a 23-segment x 5-grid display. figure 15-18. display data memory configuration and data reading order (display mode 2) remarks 1. <1> through <5> show the display output data reading order. 2. the slashed area shows the segment data storage area. 3. the shaded area shows the grid data storage area. in the case of example (3) in 15.9 , the contents of the data memory areas indicated by shading and slashes are as shown in figure 15-21. t0 through t6 in display mode 2 are for display patterns. therefore, designate bits 4 to 7 (digs0 to digs3) of display mode register 1 (dspm1) as 7 patterns, and bits 0 to 4 (segs0 to segs4) of display mode register 0 (dspm0) as 28 display outputs in total. if there is some memory area where rewriting display output data is unnecessary, it should be masked by setting display mode register 2 (dspm2). 0 7 0 7 0 7 0 7 0 fa30h fa31h fa32h fa33h fa34h fa35h fa36h fa37h fa38h fa39h fa3ah fa3bh fa3ch fa3dh fa3eh fa3fh t0 t1 t2 t3 t4 t5 t6 t ks t7 t8 t9 t10 t11 t12 t13 t14 t15 bit 7 display data memory fa70h <1> fa71h <5> fa72h fa73h fa74h fa75h fa76h fa77h fa78h fa79h fa7ah fa7bh fa7ch fa7dh fa7eh fa7fh fa60h <2> fa61h fa62h fa63h fa64h fa65h fa66h fa67h fa68h fa69h fa6ah fa6bh fa6ch fa6dh fa6eh fa6fh fa50h <3> fa51h fa52h fa53h fa54h fa55h fa56h fa57h fa58h fa59h fa5ah fa5bh fa5ch fa5dh fa5eh fa5fh fa40h fa41h fa42h fa43h fa44h fa45h fa46h fa47h fa48h fa49h fa4ah fa4bh fa4ch fa4dh fa4eh fa4fh <4>
chapter 15 vfd controller/driver 323 user s manual u11302ej4v0um figure 15-19. segment connection example heating middle slow temp open preheat end timer kcal g c 2a 2g 2d 2f 2b 2e 2c 1a 1f 1b 1e 1c o p n 2a 2g 2d 2f 2b 2e 2c 1a 1f 1b 1e 1c n p o m 5g 4g 3g 2g 1g 1d 1g 1d r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 1g 300 250 200 150 100 q p23 r1 p22 r2 j _ j _ p21 q _ h _ h p20 r8 n _ n _ p19 r9 o _ o _ p18 r10 p _ p _ p17 _ _ 2a _ 2a p16 _ _ 2b _ 2b p15 _ _ 2f _ 2f p14 _ _ 2g _ 2g p13 _ _ 2c _ 2c p12 r13 m _ m _ p11 r12 p10 r11 _ k _ k p9 _ p8 _ _ 1e _ 1e p7 r7 1c _ 1c _ p6 r6 p5 r5 _ 1f _ 1f p4 r4 1b _ 1b _ p3 r3 p2 _ _ 2d _ 2d p1 _ _ 2e _ 2e 1g 2g 3g 4g 5g i l1d1g1a hi j h i j fast start defrost keep warm kmkl l
chapter 15 vfd controller/driver 324 user s manual u11302ej4v0um the light timing of each segment is discussed next. in display example (3) in 15.9 , a segment spans two grids (that is, 2g and 3g, 4g and 5g). therefore, these segments will be lit at the timing from t0 to t6 as shown in figure 15-20. for example, when fast is to be lit as shown in example (3) in 15.9 , the lighting timing must be t5 in figure 15-20 because the fast segment spans the 4g and 5g grids. in addition, it can be seen from figure 15-3 that the fast segment, that is, i segment which spans 4g and 5g, can be lit in the t5 cycle. figure 15-20. grid driving timing 5g 4g 3g 2g 1g 1 display cycle t1 t0 t2 t3 t4 t5 t6 t0 key scan timing table 15-3. segment lighting timing lighting segment t0 q, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13 t1 1b, 1c, j, m, n, o, p t2 1a, 1g, 1d, i, l t3 2a, 2b, 2c, 2d, 2e, 2f, 2g, h, k, 1e, 1f t4 1b, 1c, j, m, n, o, p t5 1a, 1g, 1d, i, l t6 2a, 2b, 2c, 2d, 2e, 2f, 2g, h, k, 1e, 1f
chapter 15 vfd controller/driver 325 user s manual u11302ej4v0um figure 15-21. data memory status in 23-segment x 5-grid display mode heating middle slow temp open preheat end timer kcal g c 2a 2g 2d 2f 2b 2e 2c 1a 1f 1e 1c o 2a 2g 2d 2f 2b 2e 2c 1a 1f 1b 1e 1c n p o m 5g 4g 3g 2g 1g 1d 1g 1d r 1 1g 300 250 200 150 100 q p n hi j h i r 2 r 3 r 4 r 5 r 6 r 7 r 8 r 9 r10 r11 r12 r13 1b kl mkl fa7 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 fa6 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 fa5 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 fa4 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 t0 t1 t2 t3 t4 t5 t6 s27 s26 s25 s24 s23 s22 s21 s20 s19 s18 s17 s16 s15 s14 s13 s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 fip 27 fip 26 fip 25 fip 24 fip 23 fip 22 fip 21 fip 20 fip 19 fip 18 fip 17 fip 16 fip 15 fip 14 fip13 fip12 fip11 fip10 fip9 fip8 fip7 fip6 fip5 fip4 fip3 fip2 fip1 fip0 p23 p22 p21 p20 p19 p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 g5 g4 g3 g2 g1 fast start defrost keep warm j
chapter 15 vfd controller/driver 326 user s manual u11302ej4v0um 15.10 calculating total power dissipation the total power dissipation of the pd780208 subseries is the sum of the values of the following three parts. design your application set so that the sum is lower than the total power dissipation p t stipulated in figure 15-22 . (the recommended operating condition is 80% or lower of the rated value.) <1> cpu: the power consumed by the cpu and calculated with v dd (max.) x i dd (max.) <2> output pins: the power dissipation when the maximum current flows through the display output pins <3> pull-down resistors: the power consumed at the on-chip pull-down resistors connected to the display output pins figure 15-22. allowable total power dissipation p t (t a = 40 to +85 c) the following example assumes the case where the display examples shown in 15.9 are displayed. 15.10.1 segment type (display mode 1: dspm05 = 0) the calculation method for the total power dissipation in the case of the display example in figure 15-23 is described below. example assume the following conditions: v dd = 5 v 10%, 5.0 mhz oscillation supply current (i dd ) = 21.6 ma display output: 11 grids 10 segments (cut width = 1/16: when dims1 to dims3 = 000b) maximum current at the grid pin is 15 ma. maximum current at the segment pin is 3 ma. at the key scan timing, display output pin is off. display output voltage: grid v od = v dd 2 v (voltage drop of 2 v) segments v od = v dd 0.4 v (voltage drop of 0.4 v) fluorescent display control voltage (v load ) = 35 v mask option pull-down resistor = 25 k ? 800 600 400 200 40 0 +40 +80 temperature [ c ] power dissipation p t [mw]
chapter 15 vfd controller/driver 327 user s manual u11302ej4v0um by placing the above conditions in calculations <1> to <3>, the total dissipation can be worked out. <1> cpu power dissipation: 5.5 v 21.6 ma = 118.8 mw <2> output pin power dissipation: grid (v dd v od ) total current value of each grid digit width (1 cut width) = no. of grids + 1 2 v 15 ma 11 grids (1 1 ) = 25.8 mw 11 grids + 1 16 segment (v dd v od ) total segment current value of illuminated dots digit width (1 cut width) = no. of grids + 1 0.4 v 3 ma 31 dots (1 1 ) = 2.9 mw 11 grids + 1 16 <3> pull-down resistor power dissipation: grid (v od v load ) 2 no. of grids digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 2 v ( 35 v)) 2 11 grids (1 1 ) = 50.9 mw 25 k ? 11 grids + 1 16 segment (v od v load ) 2 no. of illuminated dots digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 0.4 v ( 35 v)) 2 31 dots (1 1 ) = 155.8 mw 25 k ? 11 grids + 1 16 total power dissipation = <1> + <2> + <3> = 118.8 + 25.8 + 2.9 + 50.9 + 155.8 = 354.2 mw in this example, the power dissipation problem is cleared because the total power dissipation does not exceed the allowable total power dissipation rating shown in figure 15-22.
chapter 15 vfd controller/driver 328 user s manual u11302ej4v0um figure 15-23 shows a display example and display data for segment type . figure 15-23. relationship between display data memory contents and segment outputs in 10-segment x 11-digit display mode t10 t9 t8 t7 t6 t5 t4 t3 t2 t1 t0 am i pm j j j f e g d b c a sun mon tue wed thu fri sat 12345678910 0 i s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 abcdef gh i j 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 1 0 0 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 fa7ah fa6ah fa79h fa69h fa78h fa68h fa77h fa67h fa76h fa66h fa75h fa65h fa74h fa64h fa73h fa63h fa72h fa62h fa71h fa61h fa70h fa60h display data memory fa6xh fa7xh h
chapter 15 vfd controller/driver 329 user s manual u11302ej4v0um 15.10.2 dot type (display mode 1: dspm05 = 0) the calculation method for the total power dissipation in the case of the display example in figure 15-24 is described below. example assume the following conditions: v dd = 5 v 10%, 5.0 mhz oscillation supply current (i dd ) = 21.6 ma display output: 16 grids 35 segments (cut width = 1/16: when dims1 to dims3 = 000b) maximum current at the grid pin is 15 ma. maximum current at the segment pin is 3 ma. at the key scan timing, display output pin is off. display output voltage: grid v od = v dd 2 v (voltage drop of 2 v) segments v od = v dd 0.4 v (voltage drop of 0.4 v) fluorescent display control voltage (v load ) = 35 v mask option pull-down resistor = 25 k ? by placing the above conditions in calculation <1> to <3>, the total dissipation can be worked out. <1> cpu power dissipation: 5.5 v 21.6 ma = 118.8 mw <2> output pin power dissipation: grid (v dd v od ) total current value of each grid digit width (1 cut width) = no. of grids + 1 2 v 15 ma 16 grids (1 1 ) = 26.5 mw 16 grids + 1 16 segment (v dd v od ) total segment current value of illuminated dots digit width (1 cut width) = no. of grids + 1 0.4 v 3 ma 168 dots (1 1 ) = 11.1 mw 16 grids + 1 16 <3> pull-down resistor power dissipation: grid (v od v load ) 2 no. of grids digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 2 v ( 35 v)) 2 16 grids (1 1 ) = 52.3 mw 25 k ? 16 grids + 1 16 segment (v od v load ) 2 no. of illuminated dots digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 0.4 v ( 35 v)) 2 168 dots (1 1 ) = 595.9 mw 25 k ? 16 grids + 1 16 total power dissipation = <1> + <2> + <3> = 118.8 + 26.5 + 11.1 + 52.3 + 595.9 = 804.6 mw in this example, the total power dissipation exceeds the allowable total power dissipation rating shown in figure 15-22. in this case, the power dissipation can be lowered by reducing the number of enabled on-chip pull-down resistors. next, calculation expressions are shown for the display example where on-chip pull-down resistors are enabled for s0 through s24 only.
chapter 15 vfd controller/driver 330 user s manual u11302ej4v0um <3> pull-down resistor power dissipation: grid (v od v load ) 2 no. of grids digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 2 v ( 35 v)) 2 16 grids (1 1 ) = 52.3 mw 25 k ? 16 grids + 1 16 segment (v od v load ) 2 no. of illuminated dots digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 0.4 v ( 35 v)) 2 110 dots (1 1 ) = 390.2 mw 25 k ? 16 grids + 1 16 total power dissipation = <1> + <2> + <3> = 118.8 + 26.5 + 11.1 + 52.3 + 390.2 = 598.9 mw in this manner, design the system so that the power dissipation does not exceed the allowable total power dissipation rating. figure 15-24 shows a display example and display data for dot type .
chapter 15 vfd controller/driver 331 user s manual u11302ej4v0um fa7fh fa6fh fa5fh fa4fh fa3fh fa7eh fa6eh fa5eh fa4eh fa3eh fa7dh fa6dh fa5dh fa4dh fa3dh fa7ch fa6ch fa5ch fa4ch fa3ch fa7bh fa6bh fa5bh fa4bh fa3bh fa7ah fa6ah fa5ah fa4ah fa3ah fa79h fa69h fa59h fa49h fa39h fa78h fa68h fa58h fa48h fa38h fa77h fa67h fa57h fa47h fa37h fa76h fa66h fa56h fa46h fa36h fa75h fa65h fa55h fa45h fa35h fa74h fa64h fa54h fa44h fa34h fa73h fa63h fa53h fa43h fa33h fa72h fa62h fa52h fa42h fa32h fa71h fa61h fa51h fa41h fa31h fa70h fa60h fa50h fa40h fa30h 1 0 0 0 1 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 4 3 2 1 0 bit 7 6 5 fa7 h fa6 h fa5 h fa4 h fa3 h t15 t14 t13 t12 t11 t10 t9 t8 t7 t6 t5 t4 t3 t2 t1 t0 s34 s33 s32 s31 s30 s29 s28 s27 s26 s25 s24 s23 s22 s21 s20 s19 s18 s17 s16 s15 s14 s13 s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 s0 to s34 s0 s5 s10 s15 s20 s25 s30 s1 s6 s11 s16 s21 s26 s31 s2 s7 s12 s17 s22 s27 s32 s3 s8 s13 s18 s23 s28 s33 s4 s9 s14 s19 s24 s29 s34 display data memory figure 15-24. relationship between display data memory contents and segment outputs in 35-segment x 16-digit display mode
chapter 15 vfd controller/driver 332 user s manual u11302ej4v0um 15.10.3 display type in which a segment spans two or more grids (display mode 2: dspm05 = 1) the calculation method for the total power dissipation in the case of the display example in figure 15-26 is described below. example assume the following conditions: v dd = 5 v 10%, 5.0 mhz oscillation supply current (i dd ) = 21.6 ma display output: 23 segments 7 patterns (cut width = 1/16: when dims1 to dims3 = 000b) maximum current at the display output pin is 15 ma. display output voltage (v od ) = v dd 2 v (voltage drop of 2 v) fluorescent display control voltage (v load ) = 35 v mask option pull-down resistor = 25 k ? by placing the above conditions in calculation <1> to <3>, the total dissipation can be worked out. <1> cpu power dissipation: 5.5 v 21.6 ma = 118.8 mw <2> output pin power dissipation: (v dd v od ) total current value of each grid digit width (1 cut width) = no. of grids + 1 2 v 15 ma 9 grids (1 1 ) = 31.6 mw 7 grids + 1 16 <3> pull-down resistor power dissipation: grid (v od v load ) 2 no. of grids digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 2 v ( 35 v)) 2 9 grids (1 1 ) = 62.5 mw 25 k ? 7 grids + 1 16 segment (v od v load ) 2 no. of illuminated dots digit width (1 cut width) = pull-down resistor value no. of grids + 1 (5.5 v 0.5 v ( 35 v)) 2 22 dots (1 1 ) = 152.8 mw 25 k ? 7 grids + 1 16 total power dissipation = <1> + <2> + <3> = 118.8 + 31.6 + 62.5 + 152.8 = 365.7 mw in this example, the power dissipation problem is cleared because the total power dissipation does not exceed the allowable total power dissipation rating shown in figure 15-22. figure 15-25 shows the grid driving timing, and figure 15-26 shows a display example and display data of a display type in which a segment spans two or more grids.
chapter 15 vfd controller/driver 333 user s manual u11302ej4v0um 5g 4g 3g 2g 1g 1 display cycle t1 t0 t2 t3 t4 t5 t6 t0 key scan timing figure 15-25. grid driving timing
chapter 15 vfd controller/driver 334 user s manual u11302ej4v0um figure 15-26. data memory status in 23-segment x 5-grid display mode heating fast middle slow start temp defrost open preheat keep warm end timer kcal g c 2a 2g 2d 2f 2b 2e 2c 1a 1f 1e 1c o 2a 2g 2d 2f 2b 2e 2c 1a 1f 1b 1e 1c n p o m 5g 4g 3g 2g 1g 1d 1g 1d r 1 1g 300 250 200 150 100 q p n hi j h i r 2 r 3 r 4 r 5 r 6 r 7 r 8 r 9 r10 r11 r12 r13 1b kl m kl fa7 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 fa6 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 fa5 0 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 fa4 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 t0 t1 t2 t3 t4 t5 t6 s27 s26 s25 s24 s23 s22 s21 s20 s19 s18 s17 s16 s15 s14 s13 s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 fip 27 fip 26 fip 25 fip 24 fip 23 fip 22 fip 21 fip 20 fip 19 fip 18 fip 17 fip 16 fip 15 fip 14 fip13 fip12 fip11 fip10 fip9 fip8 fip7 fip6 fip5 fip4 fip3 fip2 fip1 fip0 p23 p22 p21 p20 p19 p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 g5 g4 g3 g2 g1 j
335 user? manual u11302ej4v0um chapter 16 interrupt and test functions 16.1 interrupt function types the following three types of interrupt functions are used. (1) non-maskable interrupt this interrupt is acknowledged unconditionally (that is, even in the interrupt disabled state). it does not undergo interrupt priority control and is given top priority over all other interrupt requests. a standby release signal is generated. one interrupt request from the watchdog timer is provided as a non-maskable interrupt. (2) maskable interrupts these interrupts undergo mask control. maskable interrupts can be divided into a high interrupt priority group and a low interrupt priority group by setting the priority specification flag register (pr0l and pr0h). multiple interrupt servicing of high-priority interrupts can be applied to low-priority interrupts. if two or more interrupts with the same priority are simultaneously generated, each interrupt has a predetermined priority (see table 16-1 ). a standby release signal is generated. four external interrupt requests and 9 internal interrupt requests are provided as maskable interrupts. (3) software interrupt this is a vectored interrupt generated by executing the brk instruction. it is acknowledged even in the interrupt disabled state. the software interrupt does not undergo interrupt priority control.
336 chapter 16 interrupt and test functions user? manual u11302ej4v0um 16.2 interrupt sources and configuration a total of 15 interrupt sources are provided including non-maskable, maskable, and software interrupts (see table 16-1 ). table 16-1. interrupt source list interrupt default interrupt source internal/ vector basic type priority note 1 name trigger external table configuration address type note 2 non- intwdt watchdog timer overflow (with internal 0004h (a) maskable watchdog timer mode 1 selected) maskable 0 intwdt watchdog timer overflow (with (b) interval timer mode selected) 1 intp0 pin input edge detection external 0006h (c) 2 intp1 0008h (d) 3 intp2 000ah 4 intp3 000ch 5 intcsi0 end of serial interface channel 0 transfer internal 000eh (b) 6 intcsi1 end of serial interface channel 1 transfer 0010h 7 inttm3 reference time interval signal from 0012h watch timer 8 inttm0 generation of 16-bit timer/event counter 0014h match signal 9 inttm1 generation of 8-bit timer/event 0016h counter 1 match signal 10 inttm2 generation of 8 bit timer/event 0018h counter 2 match signal 11 intad end of a/d converter conversion 001ah 12 intks key scan timing from vfd controller/driver 001ch software brk brk instruction execution 003eh (e) notes 1. default priorities are intended for two or more simultaneously generated maskable interrupt requests. 0 is the highest priority and 12 is the lowest priority. 2. basic configuration types (a) through (e) correspond to (a) through (e) on the following pages.
337 chapter 16 interrupt and test functions user? manual u11302ej4v0um figure 16-1. basic configuration of interrupt function (1/2) (a) internal non-maskable interrupt (b) internal maskable interrupt (c) external maskable interrupt (intp0) internal bus priority controller vector table address generator standby release signal interrupt request internal bus ie pr isp mk if interrupt request priority controller vector table address generator standby release signal internal bus ie pr isp mk if priority controller vector table address generator standby release signal interrupt request sampling clock edge detector sampling clock select register (scs) external interrupt mode register (intm0)
338 chapter 16 interrupt and test functions user? manual u11302ej4v0um figure 16-1. basic configuration of interrupt function (2/2) (d) external maskable interrupt (except intp0) if: interrupt request flag ie: interrupt enable flag isp: in-service priority flag mk: interrupt mask flag pr: priority specification flag (e) software interrupt internal bus vector table address generator interrupt request external interrupt mode register (intm0) edge detector interrupt request ie pr isp mk if priority controller vector table address generator standby release signal internal bus
339 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.3 interrupt function control registers the following six types of registers are used to control the interrupt functions. interrupt request flag register (if0l, if0h) interrupt mask flag register (mk0l, mk0h) priority specification flag register (pr0l, pr0h) external interrupt mode register (intm0) sampling clock select register (scs) program status word (psw) table 16-2 gives a listing of interrupt request flags, interrupt mask flags, and priority specification flags corresponding to interrupt request sources. table 16-2. various flags corresponding to interrupt request sources interrupt source interrupt request flag interrupt mask flag priority specification flag register register register intwdt tmif4 if0l tmmk4 mk0l tmpr4 pr0l intp0 pif0 pmk0 ppr0 intp1 pif1 pmk1 ppr1 intp2 pif2 pmk2 ppr2 intp3 pif3 pmk3 ppr3 intcsi0 csiif0 csimk0 csipr0 intcsi1 csiif1 csimk1 csipr1 inttm3 tmif3 tmmk3 tmpr3 inttm0 tmif0 if0h tmmk0 mk0h tmpr0 pr0h inttm1 tmif1 tmmk1 tmpr1 inttm2 tmif2 tmmk2 tmpr2 intad adif admk adpr intks ksif ksmk kspr
340 chapter 16 interrupt and test functions user s manual u11302ej4v0um (1) interrupt request flag registers (if0l, if0h) the interrupt request flag is set to 1 when the corresponding interrupt request is generated or an instruction is executed. it is cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or upon application of reset. if0l and if0h are set with a 1-bit or 8-bit memory manipulation instruction. if if0l and if0h are used as a 16-bit register if0, use a 16-bit memory manipulation instruction for setting. reset input clears these registers to 00h. figure 16-2. format of interrupt request flag register note wtif is the test input flag. a vectored interrupt request is not generated. cautions 1. the tmif4 flag is r/w enabled only when the watchdog timer is used as an interval timer. if the watchdog timer is used in watchdog timer mode 1, set the tmif4 flag to 0. 2. always set bits 6 and 7 of if0h to 0. 3. when an interrupt is acknowledged, the interrupt request flag is automatically cleared, and then servicing of the interrupt routine is started. 4. when the interrupt request flag register is manipulated (including by a 1-bit memory manipulation instruction), if an interrupt request corresponding to another flag in the same register is generated, the flag corresponding to that interrupt request may not be set to 1. tmif0 if0h 7 6 <5> <4> <3> <2> <1> <0> xxif interrupt request flag ffe1h tmif1 adif tmif2 ksif wtif note 0 0 00h r/w 0 no interrupt request signal 1 interrupt request signal is generated: interrupt request state tmif4 if0l <7> <6> <5> <4> <3> <2> symbol <1> <0> ffe0h pif0 pif2 pif1 pif3 csiif0 csiif1 tmif3 address after reset r/w 00h r/w
341 chapter 16 interrupt and test functions user s manual u11302ej4v0um (2) interrupt mask flag registers (mk0l, mk0h) the interrupt mask flag is used to enable/disable the corresponding maskable interrupt servicing and to set standby clear enable/disable. mk0l and mk0h are set with a 1-bit or 8-bit memory manipulation instruction. if mk0l and mk0h are used as a 16-bit register mk0, use a 16-bit memory manipulation instruction for setting. reset input sets these registers to ffh. figure 16-3. format of interrupt mask flag register note wtmk controls standby mode release enable/disable. this bit does not control the interrupt function. cautions 1. if the tmmk4 flag is read when the watchdog timer is used in watchdog timer mode 1, the mk0 value becomes undefined. 2. because port 0 has an alternate function as an external interrupt request input, when the output level is changed by specifying the output mode of the port function, an interrupt request flag is set. therefore, the interrupt mask flag should be set to 1 before using the output mode. 3. always set bits 6 and 7 of mk0h to 1. tmmk0 mk0h 7 6 <5> <4> <3> <2> <1> <0> xxmk interrupt servicing and standby mode control ffe5h tmmk1 admk tmmk2 ksmk wtmk note 1 1 ffh r/w 0 interrupt servicing enabled, standby mode release enabled 1 interrupt servicing disabled, standby mode release disabled tmmk4 mk0l <7> <6> <5> <4> <3> <2> symbol <1> <0> ffe4h pmk0 pmk2 pmk1 pmk3 csimk0 csimk1 tmmk3 address after reset r/w ffh r/w
342 chapter 16 interrupt and test functions user s manual u11302ej4v0um (3) priority specification flag registers (pr0l, pr0h) the priority specification flag is used to set the corresponding maskable interrupt priority order. pr0l and pr0h are set with a 1-bit or 8-bit memory manipulation instruction. if pr0l and pr0h are used as a 16-bit register pr0, use a 16-bit memory manipulation instruction for setting. reset input sets these registers to ffh. figure 16-4. format of priority specification flag register cautions 1. when the watchdog timer is used in watchdog timer mode 1, set the tmpr4 flag to 1. 2. always set bits 5 to 7 of pr0h to 1. tmpr0 pr0h 7 6 5 <4> <3> <2> <1> <0> xxpr priority level selection ffe9h tmpr1 adpr tmpr2 kspr 1 1 1 ffh r/w 0 high priority level 1 low priority level tmpr4 pr0l <7> <6> <5> <4> <3> <2> symbol <1> <0> ffe8h ppr0 ppr2 ppr1 ppr3 csipr0 csipr1 tmpr3 address after reset r/w ffh r/w
343 chapter 16 interrupt and test functions user s manual u11302ej4v0um (4) external interrupt mode register (intm0) this register sets the valid edge for intp0 to intp2 and ti0. intm0 is set with an 8-bit memory manipulation instruction. reset input clears intm0 to 00h. remarks 1. intp0 is also used for ti0/p00. 2. intp3 is fixed to the falling edge. figure 16-5. format of external interrupt mode register caution when using the intp0/ti0/p00 pin as a timer input pin (ti0), stop the operation of the 16-bit timer by clearing bits 1 to 3 (tmc01 to tmc03) of the 16-bit timer mode control register (tmc0) to 0, 0, 0, before setting the valid edge of ti0. when using the intp0/ti0/p00 pin as an external interrupt input pin (intp0), the valid edge of intp0 may be set while the 16-bit timer is operating. 6543210 7 symbol intm0 es31 es30 es21 es20 es11 es10 0 0 ffech 00h r/w address after reset r/w es11 0 0 1 intp0/ti0 valid edge selection falling edge rising edge setting prohibited es10 0 1 0 1 both falling and rising edges 1 es21 0 0 1 intp1 valid edge selection falling edge rising edge setting prohibited es20 0 1 0 1 both falling and rising edges 1 es31 0 0 1 intp2 valid edge selection falling edge rising edge setting prohibited es30 0 1 0 1 both falling and rising edges 1
344 chapter 16 interrupt and test functions user s manual u11302ej4v0um (5) sampling clock select register (scs) this register is used to set the clock used to sample the valid edge input to intp0. when remote controlled data reception is carried out using intp0, digital noise is eliminated using the sampling clock. scs is set with an 8-bit memory manipulation instruction. reset input clears scs to 00h. figure 16-6. format of sampling clock select register caution f x /2 n + 1 is the clock supplied to the cpu, f x /2 6 and f x /2 7 are the clocks supplied to the peripheral hardware. f x /2 n + 1 stops in the halt mode. remarks 1. n: value (n = 0 to 4) of bits 0 to 2 (pcc0 to pcc2) of processor clock control register (pcc) 2. f x : main system clock oscillation frequency 3. figures in parentheses apply to operation with f x = 5.0 mhz. 6543210 7 symbol scs 0 0 0 0 0 0 scs1 scs0 ff47h 00h r/w address after reset r/w scs1 0 0 1 intp0 sampling clock selection f x /2 n + 1 setting prohibited f x /2 6 (78.1 khz) scs0 0 1 0 1f x /2 7 (39.1 khz) 1
345 chapter 16 interrupt and test functions user s manual u11302ej4v0um the noise eliminator sets the interrupt request flag (pif0) to 1 if the input level of the sampled intp0 is active twice in succession. figure 16-7 shows the noise eliminator i/o timing. figure 16-7. noise eliminator i/o timing (when rising edge is detected) (a) when input is less than the sampling cycle (t smp ) (b) when input is equal to or twice the sampling cycle (t smp ) (c) when input is twice or more than the sampling cycle (t smp ) t smp sampling clock intp0 pif0 "l" the pif0 output remains low because the level of intp0 is not high when it is sampled. t smp sampling clock intp0 pif0 the pif0 flag is set to 1 because the sampled intp0 level is high twice in succession in <2>. <1> <2> t smp sampling clock intp0 pif0 the pif0 flag is set to 1 when intp0 goes high twice in succession.
346 chapter 16 interrupt and test functions user s manual u11302ej4v0um (6) program status word (psw) the program status word is a register used to hold the instruction execution result and the current status for interrupt requests. the ie flag used to set maskable interrupt enable/disable and the isp flag used to control multiple interrupt servicing are mapped to the psw. besides 8-bit unit read/write, this register can carry out operations using bit manipulation and dedicated instructions (ei and di). when a vectored interrupt request is acknowledged or when the brk instruction is executed, the contents of the psw are automatically saved into the stack, and the ie flag is reset to 0. if a maskable interrupt request is acknowledged, the contents of the priority specification flag of the acknowledged interrupt are transferred to the isp flag. the contents of the psw are also saved to the stack by the push psw instruction. they are reset from the stack with the reti, retb, and pop psw instructions. reset input sets psw to 02h. figure 16-8. format of program status word 7 ie symbol psw 6 z 5 rbs1 4 ac 3 rbs0 2 0 1 isp 0 cy 02h after reset isp 0 used when normal instruction is executed priority of interrupt currently being serviced high-priority interrupt servicing (low-priority interrupts disabled) 1 interrupt request not acknowledged or low-priority interrupt servicing (all maskable interrupts enabled) ie interrupt request acknowledgment enable/disable 0 disabled 1 enabled
347 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.4 interrupt servicing operations 16.4.1 non-maskable interrupt request acknowledgment operation a non-maskable interrupt request is unconditionally acknowledged even if in an interrupt request acknowledgment disabled state. it does not undergo interrupt priority control and has highest priority over all other interrupts. if a non-maskable interrupt request is acknowledged, the contents of program status word (psw) and program counter (pc) are saved in the stacks in that order. then, the ie and isp flags are reset to 0, and the vector table contents are loaded into the pc and branched. a new non-maskable interrupt request generated during execution of a non-maskable interrupt servicing program is acknowledged after execution of the current non-maskable interrupt servicing program is terminated (following reti instruction execution) and one main routine instruction is executed. if a new non-maskable interrupt request is generated twice or more during non-maskable interrupt service program execution, only one non-maskable interrupt request is acknowledged after termination of the non-maskable interrupt service program execution. figure 16-9 shows the flowchart illustrating generation and acknowledgment of a non-maskable interrupt request. figure 16-10 shows the timing of acknowledging a non-maskable interrupt request. figure 16-11 illustrates how nested non-maskable interrupt requests are acknowledged.
348 chapter 16 interrupt and test functions user? manual u11302ej4v0um figure 16-9. non-maskable interrupt request acknowledgment flowchart wdtm: watchdog timer mode register wdt: watchdog timer figure 16-10. non-maskable interrupt request acknowledgment timing wdtm4 = 1 (with watchdog timer mode selected)? overflow in wdt? wdtm3 = 0 (with non-maskable interrupt request selected)? interrupt request generation wdt interrupt servicing? interrupt control register unaccessed? interrupt service start interrupt request held pending reset processing interval timer no ye s ye s no ye s no ye s no ye s no start instruction instruction cpu processing tmif4 psw and pc save, jump to interrupt servicing interrupt servicing program interrupt request generated during this interval is acknowledged at . tmif4: watchdog timer interrupt request flag
349 chapter 16 interrupt and test functions user s manual u11302ej4v0um figure 16-11. non-maskable interrupt request acknowledgment operation (a) if a new non-maskable interrupt request is generated during non-maskable interrupt servicing program execution (b) if two non-maskable interrupt requests are generated during non-maskable interrupt servicing program execution main routine nmi request <1> execution of 1 instruction nmi request <2> execution of nmi request <1> nmi request <2> held pending servicing of pending nmi request <2> main routine nmi request <1> execution of 1 instruction execution of nmi request <1> nmi request <2> held pending nmi request <3> held pending servicing of pending nmi request <2> nmi request <3> not acknowledged (although two or more nmi requests have been generated, only one request is acknowledged.) nmi request <2> nmi request <3>
350 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.4.2 maskable interrupt request acknowledgment operation a maskable interrupt request becomes acknowledgeable when an interrupt request flag is set to 1 and the mask (mk) flag of the interrupt request is cleared to 0. a vectored interrupt request is acknowledged in the interrupt enabled state (with ie flag set to 1). however, a low-priority interrupt is not acknowledged during high-priority interrupt request servicing (with isp flag reset to 0). table 16-3 shows the time required until interrupt servicing is executed after a maskable interrupt request has been generated. for the interrupt request acknowledgment timing, refer to figures 16-13 and 16-14. table 16-3. times from maskable interrupt request generation to interrupt servicing minimum time maximum time note when pr = 0 7 clock cycles 32 clock cycles when pr = 1 8 clock cycles 33 clock cycles note if an interrupt request is generated just before a divide instruction, the wait time is maximized. remark 1 clock cycle = 1/f cpu (f cpu : cpu clock) if two or more maskable interrupt requests are generated simultaneously, the request specified as higher priority by the priority specification flag is acknowledged first. if the same priority is specified by the priority specification flag , the interrupt with the highest default priority is acknowledged first. any pending interrupt requests are acknowledged when they become acknowledgeable. figure 16-12 shows interrupt request acknowledgment algorithms. if a maskable interrupt request is acknowledged, the contents of the program status word (psw) and program counter (pc) are saved in the stacks in that order. then, the ie flag is reset to 0, and the acknowledged interrupt request priority specification flag contents are transferred to the isp flag. further, the vector table data determined for each interrupt request is loaded into the pc and branched. return from the interrupt is possible with the reti instruction.
351 chapter 16 interrupt and test functions user s manual u11302ej4v0um figure 16-12. interrupt request acknowledge processing algorithm if: interrupt request flag mk: interrupt mask flag pr: priority specification flag ie: flag controlling acknowledgment of maskable interrupt request (1 = enabled, 0 = disabled) isp: flag indicating priority of interrupt currently serviced (0 = interrupt with high priority is serviced, 1 = no interrupt request is acknowledged, or interrupt with low priority is serviced) start if = 1? mk = 0? pr = 0? any simultaneously generated pr = 0 interrupt requests? any simultaneously generated high-priority interrupt requests? ie = 1? isp = 1? vectored interrupt servicing interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending interrupt request held pending vectored interrupt servicing any high- priority interrupt request among simultaneously generated pr = 0 interrupt requests? ie = 1? yes (high priority) ye s no ye s no no no yes (interrupt request generation) no ye s no (low priority) ye s ye s no ye s ye s no no
352 chapter 16 interrupt and test functions user s manual u11302ej4v0um figure 16-13. interrupt request acknowledgment timing (minimum time) remark 1 clock cycle = 1/f cpu (f cpu : cpu clock) figure 16-14. interrupt request acknowledgment timing (maximum time) remark 1 clock cycle = 1/f cpu (f cpu : cpu clock) 16.4.3 software interrupt request acknowledgment operation a software interrupt request is acknowledged by brk instruction execution. software interrupts cannot be disabled. if a software interrupt request is acknowledged, the contents of the program status word (psw) and program counter (pc) are saved in the stacks in that order, the ie flag is reset to 0 and the contents of the vector tables (003eh and 003fh) are loaded into the pc and branched. return from the software interrupt is possible with the retb instruction. caution do not use the reti instruction for returning from the software interrupt. instruction instruction psw and pc save, jump to interrupt servicing 6 clocks interrupt servicing program 8 clocks 7 clocks cpu processing if ( pr = 1) if ( pr = 0) instruction divide instruction psw and pc save, jump to interrupt servicing 6 clocks interrupt servicing program 33 clocks 32 clocks cpu processing if ( pr = 1) if ( pr = 0) 25 clocks
353 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.4.4 multiple interrupt servicing multiple interrupt servicing occurs when an interrupt request is acknowledged during execution of another interrupt. multiple interrupt servicing does not occur unless the interrupt request acknowledgment enabled state is selected (ie = 1) (except non-maskable interrupts). also, when an interrupt request is received, interrupt request acknowledgment becomes disabled (ie = 0). therefore, to enable multiple interrupt servicing, it is necessary to set (to 1) the ie flag with the ei instruction during interrupt servicing to enable interrupt acknowledgment. moreover, even if interrupts are enabled, multiple interrupt servicing may not be enabled, this being subject to interrupt priority control. two types of priority control are available: default priority control and programmable priority control. programmable priority control is used for multiple interrupt servicing. in the interrupt enabled state, if an interrupt request with a priority equal to or higher than that of the interrupt currently being serviced is generated, it is acknowledged for multiple interrupt servicing. if an interrupt with a priority lower than that of the interrupt currently being serviced is generated during interrupt servicing, it is not acknowledged for multiple interrupt servicing. interrupt requests that are not enabled because the interrupt disabled state is set or they have a lower priority are held pending. when servicing of the current interrupt ends, the pending interrupt request is acknowledged following execution of one main processing instruction. multiple interrupt servicing is not possible during non-maskable interrupt servicing. table 16-4 shows interrupt requests enabled for multiple interrupt servicing, and figure 16-15 shows multiple interrupt servicing examples. table 16-4. interrupt request enabled for multiple interrupt during interrupt servicing maskable interrupt request pr = 0 pr = 1 interrupt servicing ie = 1 ie = 0 ie = 1 ie = 0 non-maskable interrupt d dddd e maskable interrupt isp = 0 e e d d d e isp = 1 e e d e d e software interrupt e e d e d e remarks 1. e: multiple interrupt servicing enabled d: multiple interrupt servicing disabled 2. isp and ie are flags contained in the psw. isp = 0: an interrupt with higher priority is being serviced isp = 1: an interrupt request is not acknowledged or an interrupt with lower priority is being serviced ie = 0: interrupt request acknowledgment is disabled ie = 1: interrupt request acknowledgment is enabled 3. pr is a flag contained in pr0l and pr0h. pr = 0: higher priority level pr = 1: lower priority level non-maskable interrupt request software interrupt request multiple interrupt servicing request
354 chapter 16 interrupt and test functions user s manual u11302ej4v0um figure 16-15. multiple interrupt servicing example (1/2) example 1. two interrupts are generated during interrupt intxx servicing, two interrupt requests, intyy and intzz are acknowledged, and multiple interrupt servicing is generated. an ei instruction is issued before each interrupt request acknowledgment, and the interrupt request acknowledgment enabled state is set. example 2. multiple interrupt servicing is not generated due to priority control the interrupt request intyy generated during interrupt intxx servicing is not acknowledged because its interrupt priority is lower than that of intxx, and multiple interrupt servicing is not generated. the intyy request is held pending and acknowledged after execution of 1 instruction of the main processing. pr = 0: higher priority level pr = 1: lower priority level ie = 0: interrupt request acknowledgment disabled main processing ei intxx (pr = 1) intyy (pr = 0) ie = 0 ei reti intxx servicing intzz (pr = 0) ie = 0 ei reti intyy servicing ie = 0 reti intzz servicing main processing intxx servicing intyy servicing intxx (pr = 0) 1 instruction execution ie = 0 intyy (pr = 1) ei ie = 0 ei reti reti
355 chapter 16 interrupt and test functions user s manual u11302ej4v0um figure 16-15. multiple interrupt servicing example (2/2) example 3. multiple interrupt servicing is not generated because interrupts are not enabled because interrupts are not enabled in interrupt intxx servicing (an ei instruction is not issued), interrupt request intyy is not acknowledged, and multiple interrupt servicing is not generated. the intyy request is held pending and acknowledged after execution of 1 instruction of the main processing. pr = 0: higher priority level ie = 0: interrupt request acknowledgment disabled main processing intxx servicing intyy servicing intxx (pr = 0) 1 instruction execution ie = 0 intyy (pr = 0) ie = 0 reti reti ei
356 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.4.5 interrupt request hold some instructions hold an interrupt request, if any, pending until the completion of execution of the next instruction. these instructions (that hold an interrupt request pending) are listed below. mov psw, #byte mov a, psw mov psw, a mov1 psw.bit, cy mov1 cy, psw.bit and1 cy, psw.bit or1 cy, psw.bit xor1 cy, psw.bit set1 psw.bit clr1 psw.bit retb reti push psw pop psw bt psw.bit, $addr16 bf psw.bit, $addr16 btclr psw.bit, $addr16 ei di manipulation instructions for if0l, if0h, mk0l, mk0h, pr0l, pr0h and intm0 registers caution the brk instruction does not belong to the above group of instructions. however, the software interrupt that is started by execution of the brk instruction clears the ie flag to 0. therefore, even if a maskable interrupt request is generated, it is not acknowledged when the brk instruction is executed. however, a non-maskable interrupt request is acknowledged. the timing at which interrupt requests are held pending is shown in figure 16-16. figure 16-16. interrupt request hold remarks 1. instruction n: interrupt request hold instruction 2. instruction m: instruction other than interrupt request hold instruction 3. the pr (priority level) values do not affect the operation of if (interrupt request). cpu processing if instruction n instruction m save psw and pc, jump to interrupt servicing interrupt servicing program
357 chapter 16 interrupt and test functions user s manual u11302ej4v0um 16.5 test functions the internal test input flag (wtif) is set to 1 and a standby release signal is generated when the watch timer overflows. unlike the interrupt function, this function does not perform vector processing. the basic configuration is shown in figure 16-17. figure 16-17. basic configuration of test function if: test input flag mk: test mask flag 16.5.1 test function control registers the test function is controlled by the following two registers. interrupt request flag register 0h (if0h) interrupt mask flag register 0h (mk0h) the names of the test input flag and test mask flag corresponding to the test input signal name are as follows. test input signal name test input flag test mask flag intwt wtif wtmk internal bus mk if test input source (intwt) standby release signal
358 chapter 16 interrupt and test functions user s manual u11302ej4v0um (1) interrupt request flag register (if0h) this register indicates whether a watch timer overflow is detected or not. if0h is set with a 1-bit or 8-bit memory manipulation instruction. reset input clears if0h to 00h. figure 16-18. format of interrupt request flag register 0h (2) interrupt mask flag register (mk0h) this register is used to set the standby mode enable/disable at the time the standby mode is released by the watch timer. mk0h is set with a 1-bit or 8-bit memory manipulation instruction. reset input sets mk0h to ffh. figure 16-19. format of interrupt mask flag register 0h 16.5.2 test input signal acknowledgment operation the internal test input signal (intwt) is generated when the watch timer overflows. this signal sets the wtif flag. at this time, the standby release signal is generated if it is not masked by the interrupt mask flag (wtmk). by checking the wtif flag in a cycle shorter than the overflow cycle of the watch timer, a watch function can be realized. tmif0 if0h 7 6 <5> <4> <3> <2> <1> <0> wtif watch timer overflow detection flag no detection detection ffe1h tmif1 adif tmif2 ksif wtif 0 0 00h r/w 0 1 symbol address after reset r/w tmmk0 mk0h 7 6 <5> <4> <3> <2> <1> <0> wtmk standby mode control by watch timer standby mode release enabled standby mode release disabled ffe5h tmmk1 admk tmmk2 ksmk wtmk 1 1 ffh r/w 0 1 symbol address after reset r/w
359 user? manual u11302ej4v0um chapter 17 standby function 17.1 standby function and configuration 17.1.1 standby function the standby function is used to decrease the power consumption of the system. the following two modes are available. (1) halt mode halt instruction execution sets the halt mode. in the halt mode, the cpu operation clock stops. the system clock oscillator continues oscillation. in this mode, the power consumption cannot be decreased as much as in the stop mode, but the halt mode is effective for restarting immediately upon interrupt request and carrying out intermittent operations like clock operations. (2) stop mode stop instruction execution sets the stop mode. in the stop mode, the main system clock oscillator stops and the whole system stops, so the cpu power consumption can be considerably decreased. data memory low-voltage hold (down to v dd = 2 v) is possible. thus, the stop mode is effective for holding data memory contents with ultra-low power consumption. because this mode can be released by an interrupt request, it enables intermittent operations to be carried out. however, because a wait time is necessary to secure the oscillation stabilization time after the stop mode is released, select the halt mode if it is necessary to start processing immediately upon interrupt request. in either mode, all the contents of the registers, flags, and data memory just before standby mode is set are held. the i/o port output latch and output buffer statuses are also held. cautions 1. the stop mode can be used only when the system operates with the main system clock (subsystem clock oscillation cannot be stopped). the halt mode can be used with either the main system clock or the subsystem clock. 2. when proceeding to the stop mode, be sure to stop the peripheral hardware operation operated with the main system clock and execute the stop instruction. 3. to reduce the power consumption of the a/d converter, set bit 7 (cs) of the a/d converter mode register (adm) to 0 to stop the a/d converter? operation before executing the halt or stop instruction.
chapter 17 standby function 360 user? manual u11302ej4v0um 17.1.2 standby function control register the wait time after the stop mode is released by an interrupt request until the oscillation stabilizes is controlled by the oscillation stabilization time select register (osts). osts is set with an 8-bit memory manipulation instruction. reset input sets osts to 04h. therefore, when the stop mode is released by reset input, the time until it is released is 2 17 /fx. figure 17-1. format of oscillation stabilization time select register caution the wait time after stop mode release does not include the time from stop mode release to clock oscillation start (see ??below), regardless of whether the stop mode is released by reset input or by interrupt request generation. remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. 6543210 7 symbol osts 0 0 0 0 0 osts2 osts1 osts0 fffah 04h r/w address after reset r/w osts2 0 0 0 osts1 0 0 1 01 10 other than above selection of oscillation stabilization time after stop mode is released 2 12 /f x (819 s) osts0 0 1 0 1 setting prohibited 0 2 17 /f x (26.2 ms) 2 16 /f x (13.1 ms) 2 15 /f x (6.55 ms) 2 14 /f x (3.28 ms) v ss stop mode release x1 pin voltage waveform a
chapter 17 standby function 361 user s manual u11302ej4v0um 17.2 standby function operations 17.2.1 halt mode (1) halt mode set and operating status the halt mode is set by executing the halt instruction. it can be set during main system clock or the subsystem clock operation. the operating status in the halt mode is described below. table 17-1. halt mode operating status halt mode setting item when halt instruction is executed during main system clock operation when halt instruction is executed during subsystem clock operation when main system clock oscillation continues when main system clock oscillation stops notes 1. including the case where an external clock is not supplied as the subsystem clock 2. including the case where an external clock is supplied as the subsystem clock clock generator both main system clock and subsystem clock can be oscillated. clock supply to the cpu stops. cpu operation stopped ports (output latch) status before halt instruction execution is held. 16-bit timer/event counter operation enabled operation stopped 8-bit timer/event counter operation enabled when ti1 and ti2 are watchdog timer selected for the count clock. a/d converter operation stopped operation stopped watch timer operation enabled operation enabled operation enabled when f x /2 8 is when f xt is selected for selected for the the count clock. count clock. clock output operation enabled operation enabled operation enabled when f x /2 3 to f x /2 8 when f xt is selected for is selected for the the output clock. output clock. buzzer output operation enabled buz is low level. vfd controller/driver operation disabled serial other than operation enabled operation enabled interface automatic when external sck is transmit/ selected. receive function automatic operation stopped transmit/ receive function external intp0 operation enabled when the clock for the peripheral hardware operation stopped interrupts (fx/2 6 or fx/2 7 ) is selected as the sampling clock. intp1 to operation enabled intp3 with subsystem clock note 2 without subsystem clock note 1
chapter 17 standby function 362 user s manual u11302ej4v0um (2) halt mode release the halt mode can be released by the following four sources. (a) release by unmasked interrupt request when an unmasked interrupt request is generated, the halt mode is released. if interrupt request acknowledgment is enabled, vectored interrupt servicing is carried out. if disabled, the instruction at the next address is executed. figure 17-2. halt mode release by interrupt request generation remarks 1. the broken line indicates the case when the interrupt request which has released the standby status is acknowledged. 2. wait time will be as follows. when vectored interrupt servicing is carried out: 8 to 9 clocks when vectored interrupt servicing is not carried out: 2 to 3 clocks (b) release by non-maskable interrupt request when a non-maskable interrupt request is generated, the halt mode is released and vectored interrupt servicing is carried out regardless of whether interrupt request acknowledgment is enabled or disabled. however, a non-maskable interrupt request is not generated during subsystem clock operation. (c) release by unmasked test input when an unmasked test signal is input, the halt mode is released and the instruction at the next address to the halt instruction is executed. halt instruction interrupt request standby release signal wait wait halt mode operating mode operating mode clock oscillation
chapter 17 standby function 363 user s manual u11302ej4v0um (d) release by reset input when a reset signal is input, the halt mode is released. as is the case with a normal reset operation, the program is executed after branch to the reset vector address. figure 17-3. halt mode release by reset input remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. table 17-2. operation after halt mode release release source mk pr ie isp operation maskable interrupt request 0 0 0 next address instruction execution 001 interrupt servicing 0101 next address instruction execution 01 0 0111 interrupt servicing 1 halt mode hold non-maskable interrupt request interrupt servicing test input 0 next address instruction execution 1 halt mode hold reset input reset processing : don t care halt instruction reset signal wait (2 17 /f x : 26.2 ms) reset period halt mode operating mode oscillation stabilization wait status clock operating mode oscillation stop oscillation oscillation
chapter 17 standby function 364 user s manual u11302ej4v0um 17.2.2 stop mode (1) stop mode set and operating status the stop mode is set by executing the stop instruction. it can be set only during main system clock operation. cautions 1. when the stop mode is set, the x2 pin is internally connected to v dd via a pull-up resistor to suppress the leakage at the crystal oscillator. thus, do not use the stop mode in a system where an external clock is used for the main system clock. 2. because the interrupt request signal is used to release the standby mode, if there is an interrupt source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is immediately released if set. thus, the stop mode is reset to the halt mode immediately after execution of the stop instruction. after the wait set using the oscillation stabilization time select register (osts), the operating mode is set. the operating status in the stop mode is described below. table 17-3. stop mode operating status stop mode with subsystem clock without subsystem clock setting item clock generator only main system clock stops oscillation. cpu operation stopped output ports (output latches) status before stop instruction execution is held. 16-bit timer/event counter operation stopped 8-bit timer/event counter operation enabled only when ti1 and ti2 are selected for the count clock. watchdog timer operation stopped a/d converter watch timer operation enabled only when f xt is operation stopped selected for the count clock. clock output operation enabled when f xt is pcl is low level. selected for the output clock. buzzer output buz is low level. vfd controller/driver operation disabled operation enabled only when external input clock is selected as serial clock. operation stopped operation disabled operation enabled other than automatic transmit/receive function automatic transmit/ receive function intp0 intp1 to intp3 serial interface external interrupts
chapter 17 standby function 365 user s manual u11302ej4v0um (2) stop mode release the stop mode can be released by the following three sources. (a) release by unmasked interrupt request when an unmasked interrupt request is generated, the stop mode is released. if interrupt request acknowledgment is enabled after the lapse of oscillation stabilization time, vectored interrupt servicing is carried out. if interrupt request acknowledgment is disabled, the instruction at the next address is executed. figure 17-4. stop mode release by interrupt request generation remark the broken line indicates the case when the interrupt request which has released the standby status is acknowledged. (b) release by unmasked test input when an unmasked test signal is input, the stop mode is released. after the lapse of oscillation stabilization time, the instruction at the next address to the stop instruction is executed. stop instruction interrupt request standby release signal wait (time set by osts) stop mode operating mode oscillation stabilization wait status clock operating mode oscillation stop oscillation oscillation
chapter 17 standby function 366 user s manual u11302ej4v0um (c) release by reset input when a reset signal is input, the stop mode is released. after the lapse of oscillation stabilization time, a reset operation is carried out. figure 17-5. stop mode release by reset input remarks 1. f x : main system clock oscillation frequency 2. figures in parentheses apply to operation with f x = 5.0 mhz. table 17-4. operation after stop mode release release source mk pr ie isp operation maskable interrupt request 0 0 0 next address instruction execution 001 interrupt servicing 0101 next address instruction execution 01 0 0111 interrupt servicing 1 stop mode hold test input 0 next address instruction execution 1 stop mode hold reset input reset processing : don t care stop instruction reset signal wait (2 17 /f x : 26.2 ms) reset period stop mode operating mode oscillation stabilization wait status clock operating mode oscillation stop oscillation oscillation
367 user? manual u11302ej4v0um chapter 18 reset function 18.1 reset function the following two operations are available to generate a reset signal. (1) external reset input via reset pin (2) internal reset by watchdog timer program loop time detection external reset and internal reset have no functional differences. in both cases, program execution starts at addresses 0000h and 0001h by reset input. when a low level is input to the reset pin or the watchdog timer overflows, a reset is applied and each hardware is set to the status as shown in table 18-1. each pin is high impedance during reset input or during the oscillation stabilization time just after reset release. when a high level is input to the reset pin, the reset is released and program execution starts after the lapse of the oscillation stabilization time (2 17 /f x ). the reset applied by watchdog timer overflow is automatically released after the reset and program execution starts after the lapse of the oscillation stabilization time (2 17 /f x ) (see figures 18-2 to 18-4 ). cautions 1. for an external reset, input a low level to the reset pin for 10 s or more. 2. during reset input, main system clock oscillation remains stopped but subsystem clock oscillation continues. 3. when the stop mode is released by reset, the stop mode contents are held during reset input. however, the port pins become high impedance. figure 18-1. block diagram of reset function reset controller watchdog timer reset count clock stop overflow reset signal interrupt function
chapter 18 reset function 368 user s manual u11302ej4v0um figure 18-2. timing of reset by reset input figure 18-4. timing of reset by reset input in stop mode figure 18-3. timing of reset due to watchdog timer overflow reset internal reset signal port pin x1 delay delay normal operation reset period (oscillation stop) oscillation stabilization time wait normal operation (reset processing) hi-z watchdog timer overflow internal reset signal port pin x1 normal operation reset period (oscillation stop) oscillation stabilization time wait normal operation (reset processing) hi-z reset internal reset signal port pin x1 delay delay normal operation oscillation stabilization time wait normal operation (reset processing) hi-z stop status (oscillation stop) reset period (oscillation stop) stop instruction execution
chapter 18 reset function 369 user? manual u11302ej4v0um table 18-1. hardware status after reset (1/2) hardware status after reset program counter (pc) note 1 the contents of reset vector tables (0000h and 0001h) are set. stack pointer (sp) undefined program status word (psw) 02h ram data memory undefined note 2 general-purpose registers undefined note 2 ports (output latches) ports 0 to 3, 7 to 12 (p0 to p3, p7 to p12) 00h port mode registers (pm0, pm7) 1fh (pm1, pm2, pm3, pm10, pm11, pm12) ffh pull-up resistor option register (puo) 00h processor clock control register (pcc) 04h internal memory size switching register (ims) note 3 internal expansion ram size switching register (ixs) note 3 oscillation stabilization time select register (osts) 04h 16-bit timer/event counter timer register (tm0) 00h compare register (cr00) undefined capture register (cr01) undefined clock select register (tcl0) 00h mode control register (tmc0) 00h output control register (toc0) 00h 8-bit timer/event counter timer registers (tm1, tm2) 00h compare registers (cr10, cr20) undefined clock select register (tcl1) 00h mode control registers (tmc1, tmc2) 00h output control register (toc1) 00h notes 1. during reset input or oscillation stabilization time wait, only the pc contents among the hardware statuses become undefined. all other hardware statuses remain unchanged after reset. 2. if the reset is applied in the standby mode, the status before reset will be held after reset. 3. the after-reset values of the internal memory size switching register (ims) and internal expansion ram size switching register (ixs) depend on the product. pd780204 pd780204a pd780205 pd780205a pd780206 pd780208 pd78p0208 ims c8h cfh cah cfh cch cfh cfh ixs none 0ah
chapter 18 reset function 370 user s manual u11302ej4v0um table 18-1. hardware status after reset (2/2) hardware status after reset watch timer clock select register (tcl2) 00h watchdog timer mode register (wdtm) 00h serial interface clock select register (tcl3) 88h shift registers (sio0, sio1) undefined mode registers (csim0, csim1) 00h serial bus interface control register (sbic) 00h slave address register (sva) undefined automatic data transmit/receive control register (adtc) 00h automatic data transmit/receive address pointer (adtp) 00h automatic data transmit/receive interval specification register (adti) 00h interrupt timing specification register (sint) 00h a/d converter mode register (adm) 01h conversion result register (adcr) undefined input select register (adis) 00h vfd controller/driver display mode register 0 (dspm0) 00h display mode register 1 (dspm1) 00h display mode register 2 (dspm2) 00h interrupts request flag registers (if0l, if0h) 00h mask flag registers (mk0l, mk0h) ffh priority specification flag registers (pr0l, pr0h) ffh external interrupt mode register (intm0) 00h sampling clock select register (scs) 00h
371 users manual u11302ej4v0um chapter 19 pd78p0208 the pd78p0208 is a product integrating a one-time programmable rom (one-time prom). table 19- 1 shows the differences between the pd78p0208 and the mask rom versions ( pd780204, 780204a, 780205, 780205a, 780206, and 780208). table 19-1. differences between pd78p0208 and mask rom versions item pd78p0208 mask rom versions internal rom configuration one-time prom mask rom internal rom capacity 60 kb pd780204: 32 kb pd780204a: 32 kb pd780205: 40 kb pd780205a: 40 kb pd780206: 48 kb pd780208: 60 kb internal expansion ram capacity 1024 bytes pd780204: none pd780204a: none pd780205: none pd780205a: none pd780206: 1024 bytes pd780208: 1024 bytes change in capacity of internal possible note 1 impossible rom by means of internal memory size switching register (ims) internal expansion ram size provided (internal expansion ram pd780204, 780204a, switching register (ixs) capacity can be changed using pd780205, 780205a: not provided ixs note 2 .) pd780206, 780208: provided (however, internal expansion ram capacity cannot be changed.) ic pin none provided v pp pin provided none p30/to0 to p32/to2, p33/ti1, on-chip pull-down resistors are not on-chip pull-down resistors can be p34/ti2, p35/pcl, p36/buz, p37 provided. specified in 1-bit units by mask option. p70 to p74 on-chip pull-up resistors are not on-chip pull-up resistors can be provided. specified in 1-bit units by mask option. fip0 to fip12 on-chip pull-down resistors are on-chip pull-down resistors can be provided (connected to v load ). specified in 1-bit units by mask option. p80/fip13 to p87/fip20, on-chip pull-down resistors are not on-chip pull-down resistors can be p90/fip21 to p97/fip28, provided. specified in 1-bit units by mask option. p100/fip29 to p107/fip36, pull-down resistors can be specified to p110/fip37 to p117/fip44, be connected to either v load or v ss in 4- p120/fip45 to p127/fip52 bit units from p80. electrical specifications refer to the separate data sheet. notes 1. after reset input, the internal prom capacity is set to 60 kb. 2. after reset input, the internal expansion ram capacity is set to 1024 bytes. caution there are differences in noise immunity and noise radiation between the prom and mask rom versions. when pre-producing an application set with the prom version and then mass- producing it with the mask rom version, be sure to conduct sufficient evaluations for the commercial samples (not engineering samples) of the mask rom version.
chapter 19 pd78p0208 372 users manual u11302ej4v0um 19.1 internal memory size switching register the internal memory capacity of the pd78p0208 can be selected by using the internal memory size switching register (ims). the same memory map as that of the mask rom version with a different internal memory capacity is possible by setting ims. ims is set with an 8-bit memory manipulation instruction. reset input sets ims as shown in table 19-2.
chapter 19 pd78p0208 373 user? manual u11302ej4v0um figure 19-1. format of internal memory size switching register (ims) note the value of the internal memory size switching register after reset differs depending on the product (see table 19-2 ). table 19-2 lists the ims setting values for a memory map equivalent to the mask rom versions. table 19-2. internal memory size switching register setting values target product ims value after reset ims setting value pd780204 c8h pd780204a cfh c8h pd780205 cah pd780205a cfh cah pd780206 cch pd780208 cfh pd78p0208 cfh caution when using the pd780204, 780205, 780206, and 780208, do not set any value other than the above ims value after reset to ims. when using the pd780204a and 780205a, be sure to set the ims setting value shown in table 19-2 to ims. 6543210 7 symbol ims ram2 ram1 ram0 0 rom3 rom2 rom1 rom0 fff0h address after reset r/w rom3 1 1 rom2 0 0 11 internal rom capacity selection 32 kb 40 kb rom1 0 1 60 kb 1 setting prohibited rom0 0 0 1 other than above ram2 1 ram1 1 other than above internal high-speed ram capacity selection 1024 bytes ram0 0 setting prohibited note r/w 1 1 48 kb 00
chapter 19 pd78p0208 374 user? manual u11302ej4v0um 19.2 internal expansion ram size switching register by setting the internal expansion ram size swtiching register (ixs), the pd78p0208 can have the same memory map as used in mask rom versions that have a different internal expansion ram capacity. for the mask rom versions, ixs does not need to be set. ixs is set with an 8-bit memory manipulation instruction. reset input sets ixs to 0ah. cautions 1. the internal expansion ram size switching register (ixs) is only incorporated in the pd780206, pd780208, and pd78p0208. 2. when using a mask rom version pd780204, pd780204a, pd780205, pd780205a, pd780206, pd780208, do not set a value other than those listed in table 19-3 to ixs. figure 19-2. format of internal expansion ram size switching register table 19-3 lists the ixs setting values for a memory map equivalent to the mask rom versions. table 19-3. internal expansion ram size switching register setting values target mask rom version ixs setting value pd780204, 780204a 0ch pd780205, 780205a pd780206 0ah pd780208 ixs is not incorporated in the pd780204, pd780204a, pd780205, and pd780205a. however, if a write instruction to ixs is executed in the pd780204, pd780204a, pd780205, or pd780205a, the operation is not affected. ix ram0 ixs 765432 symbol 10 ix ram3 internal expansion ram capacity selection fff4h ix ram1 ix ram3 ix ram2 0 0 0 0 address after reset r/w 0ah w 1 1024 bytes 1 no internal expansion ram (0 bytes) setting prohibited ix ram2 0 1 other than above ix ram1 1 0 ix ram0 0 0
chapter 19 pd78p0208 375 user s manual u11302ej4v0um 19.3 prom programming the pd78p0208 incorporates a 60 kb prom as program memory. when programming, the prom programming mode is set by means of the v pp pin and the reset pin. for the connection of unused pins, refer to 1.5 pin configuration (top view) (2) prom programming mode . caution programs must be written in addresses 0000h to efffh (the last address efffh must be specified). programs cannot be written by a prom programmer that cannot specify the write address. 19.3.1 operating modes when +5 v or +12.5 v is applied to the v pp pin and a low-level signal is applied to the reset pin, the pd78p0208 is set to the prom programming mode. this is one of the operating modes shown in table 19- 4 below according to the setting of the ce, oe, and pgm pins. the prom contents can be read by setting the read mode. table 19-4. prom programming operating modes pin reset v pp v dd ce oe pgm d0 to d7 operating mode page data latch l +12.5 v +6.5 v h l h data input page write h h l high impedance byte write l h l data input program verify l l h data output program inhibit h h high impedance ll read +5 v +5 v l l h data output output disabled l h high impedance standby h high impedance : l or h (1) read mode read mode is set by setting ce to l and oe to l. (2) output disabled mode if oe is set to h, data output becomes high impedance and the output disabled mode is set. therefore, if multiple pd78p0208s are connected to the data bus, data can be read from any one device by controlling the oe pin. (3) standby mode setting ce to h sets the standby mode. in this mode, data output becomes high impedance irrespective of the status of oe.
chapter 19 pd78p0208 376 users manual u11302ej4v0um (4) page data latch mode setting ce to h, pgm to h, and oe to l at the start of the page write mode sets the page data latch mode. in this mode, 1-page 4-byte data is latched in the internal address/data latch circuit. (5) page write mode after a 1-page 4-byte address and data are latched by the page data latch mode, a page write is executed by applying a 0.1 ms program pulse (active-low) to the pgm pin while ce = h and oe = h. after this, program verification can be performed by setting ce to l and oe to l. if programming is not performed by one program pulse, repeated write and verify operations are executed x times (x 10). (6) byte write mode a byte write is executed by applying a 0.1 ms program pulse (active-low) to the pgm pin while ce = l and oe = h. after this, program verification can be performed by setting oe to l. if programming is not performed by one program pulse, repeated write and verify operations are executed x times (x 10). (7) program verify mode setting ce to l, pgm to h, and oe to l sets the program verify mode. after writing is performed, this mode should be used to check whether the data was written correctly. (8) program inhibit mode the program inhibit mode is used when the oe, v pp , and d0 to d7 pins of multiple pd78p0208s are connected in parallel, and when you wish to write to one of these devices. the page write mode or byte write mode described above is used to perform a write. at this time, the write is not performed on the device which has the pgm pin driven high.
chapter 19 pd78p0208 377 user s manual u11302ej4v0um 19.3.2 prom write procedure figure 19-3. page program mode flowchart g = start address n = last address of program start address = g v dd = 6.5 v, v pp = 12.5 v x = 0 latch address = address + 1 latch address = address + 1 latch address = address + 1 latch x = x + 1 0.1 ms program pulse verify 4 bytes address = n? v dd = 4.5 to 5.5 v, v pp = v dd all bytes verified? end of write address = address + 1 x = 10? defective product fail all pass yes pass fail no yes pass no
chapter 19 pd78p0208 378 user s manual u11302ej4v0um figure 19-4. page program mode timing a0, a1 a2 to a16 d0 to d7 v pp v dd v pp v dd v dd v dd + 1.5 ce v il v ih pgm v il v ih oe v il v ih page data latch page program program verify data input data output
chapter 19 pd78p0208 379 user s manual u11302ej4v0um figure 19-5. byte program mode flowchart g = start address n = last address of program start address = g address = address + 1 v dd = 6.5 v, v pp = 12.5 v x = 0 x = x + 1 0.1 ms program pulse verify address = n? v dd = 4.5 to 5.5 v, v pp = v dd all bytes verified end of write fail pass no yes pass fail all pass x = 10? yes no defective product
chapter 19 pd78p0208 380 user s manual u11302ej4v0um figure 19-6. byte program mode timing cautions 1. ensure that v dd is applied before v pp and removed after v pp . 2. ensure that v pp does not exceed +13.5 v including overshoot. 3. disconnecting the device while +12.5 v is being applied to v pp may have an adverse affect on reliability. d0 to d7 a0 to a16 v pp v dd v pp v dd v dd v dd + 1.5 ce v il v ih pgm v il v ih oe v il v ih program program verify data input data output
chapter 19 pd78p0208 381 user? manual u11302ej4v0um 19.3.3 prom read procedure prom contents can be read onto the external data bus (d0 to d7) using the following procedure. (1) fix the reset pin low, and supply +5 v to the v pp pin. unused pins are handled as shown in 1.5 pin configuration (top view) (2) prom programming mode . (2) supply +5 v to the v dd and v pp pins. (3) input the address of the data to be read to pins a0 to a16. (4) read mode. (5) output data to pins d0 to d7. the timing for steps (2) through (5) above is shown in figure 19-7. figure 19-7. prom read timing a0 to a16 ce (input) oe (input) address input d0 to d7 data output hi-z hi-z
chapter 19 pd78p0208 382 user s manual u11302ej4v0um 19.4 screening of one-time prom version a one-time prom device ( pd78p0208gf-3ba) cannot be fully tested by nec electronics before shipment due to the nature of prom. after the necessary data has been written, it is recommended to implement a screening process, that is, the written contents should be verified after the device has been stored under the following high-temperature conditions. storage temperature storage time 125 c 24 hours
383 user? manual u11302ej4v0um chapter 20 instruction set this chapter describes the instruction set for the pd780208 subseries. for details of the operations and mnemonics (instruction codes) of each instruction, refer to the 78k/0 series instructions user? manual (u12326e) .
chapter 20 instruction set 384 user? manual u11302ej4v0um 20.1 conventions 20.1.1 operand identifiers and description methods operands are described in the ?perand?column of each instruction in accordance with the description method of the instruction operand identifier (refer to the assembler specifications for details). when there are two or more description methods, select one of them. uppercase letters and the symbols #, !, $, and [ ] are keywords and are described as they are. each symbol has the following meaning. #: immediate data specification !: absolute address specification $: relative address specification [ ]: indirect address specification in the case of immediate data, describe an appropriate numeric value or a label. when using a label, be sure to describe the #, !, $, and [ ] symbols. for operand register identifiers, r and rp, either function names (x, a, c, etc.) or absolute names (names in parentheses in the table below, r0, r1, r2, etc.) can be used for description. table 20-1. operand identifiers and description methods identifier description method r x (r0), a (r1), c (r2), b (r3), e (r4), d (r5), l (r6), h (r7) rp ax (rp0), bc (rp1), de (rp2), hl (rp3) sfr special-function register symbol note sfrp special-function register symbol (16-bit manipulatable register, even addresses only) note saddr fe20h to ff1fh immediate data or label saddrp fe20h to ff1fh immediate data or label (even addresses only) addr16 0000h to ffffh immediate data or label (only even addresses for 16-bit data transfer instructions) addr11 0800h to 0fffh immediate data or label addr5 0040h to 007fh immediate data or label (even addresses only) word 16-bit immediate data or label byte 8-bit immediate data or label bit 3-bit immediate data or label rbn rb0 to rb3 note ffd0h to ffdfh cannot be addressed. remark for special-function register symbols, see table 3-3 special-function register list .
chapter 20 instruction set 385 user? manual u11302ej4v0um 20.1.2 description of ?peration?column a: a register; 8-bit accumulator x: x register b: b register c: c register d: d register e: e register h: h register l: l register ax: ax register pair; 16-bit accumulator bc: bc register pair de: de register pair hl: hl register pair pc: program counter sp: stack pointer psw: program status word cy: carry flag ac: auxiliary carry flag z: zero flag rbs: register bank select flag ie: interrupt request enable flag nmis: non-maskable interrupt servicing flag ( ): memory contents indicated by address or register contents in parentheses x h , x l : higher 8 bits and lower 8 bits of 16-bit register : logical product (and) : logical sum (or) : exclusive logical sum (exclusive or) : inverted data addr16: 16-bit immediate data or label jdisp8: signed 8-bit data (displacement value) 20.1.3 description of ?lag operation?column (blank): unchanged 0: cleared to 0 1: set to 1 : set/cleared according to the result r: previously saved value is restored
chapter 20 instruction set 386 user? manual u11302ej4v0um 20.2 operation list instruc- mnemonic operands bytes operation tion group mov r, #byte 2 4 r byte saddr, #byte 3 6 7 (saddr) byte sfr, #byte 3 7 sfr byte a, r note 3 12 a r r, a note 3 12 r a a, saddr 2 4 5 a (saddr) saddr, a 2 4 5 (saddr) a a, sfr 2 5 a sfr sfr, a 2 5 sfr a a, !addr16 3 8 9 a (addr16) !addr16, a 3 8 9 (addr16) a psw, #byte 3 7 psw byte a, psw 2 5 a psw psw, a 2 5 psw a a, [de] 1 4 5 a (de) [de], a 1 4 5 (de) a a, [hl] 1 4 5 a (hl) [hl], a 1 4 5 (hl) a a, [hl+byte] 2 8 9 a (hl+byte) [hl+byte], a 2 8 9 (hl+byte) a a, [hl+b] 1 6 7 a (hl+b) [hl+b], a 1 6 7 (hl+b) a a, [hl+c] 1 6 7 a (hl+c) [hl+c], a 1 6 7 (hl+c) a xch a, r note 3 12 a ? r a, saddr 2 4 6 a ? (saddr) a, sfr 2 6 a ? sfr a, !addr16 3 8 10 a ? (addr16) a, [de] 1 4 6 a ? (de) a, [hl] 1 4 6 a ? (hl) a, [hl+byte] 2 8 10 a ? (hl+byte) a, [hl+b] 2 8 10 a ? (hl+b) a, [hl+c] 2 8 10 a ? (hl+c) notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. 3. except r = a remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag 8-bit data transfer
chapter 20 instruction set 387 user? manual u11302ej4v0um instruc- mnemonic operands bytes operation tion group movw rp, #word 3 6 rp word saddrp, #word 4 8 10 (saddrp) word sfrp, #word 4 10 sfrp word ax, saddrp 2 6 8 ax (saddrp) saddrp, ax 2 6 8 (saddrp) ax ax, sfrp 2 8 ax sfrp sfrp, ax 2 8 sfrp ax ax, rp note 3 1 4 ax rp rp, ax note 3 1 4 rp ax ax, !addr16 3 10 12 ax (addr16) !addr16, ax 3 10 12 (addr16) ax xchw ax, rp note 3 1 4 ax ? rp add a, #byte 2 4 a, cy a+byte saddr, #byte 3 6 8 (saddr), cy (saddr)+byte a, r note 4 2 4 a, cy a+r r, a 2 4 r, cy r+a a, saddr 2 4 5 a, cy a+(saddr) a, !addr16 3 8 9 a, cy a+(addr16) a, [hl] 1 4 5 a, cy a+(hl) a, [hl+byte] 2 8 9 a, cy a+(hl+byte) a, [hl+b] 2 8 9 a, cy a+(hl+b) a, [hl+c] 2 8 9 a, cy a+(hl+c) addc a, #byte 2 4 a, cy a+byte+cy saddr, #byte 3 6 8 (saddr), cy (saddr)+byte+cy a, r note 4 2 4 a, cy a+r+cy r, a 2 4 r, cy r+a+cy a, saddr 2 4 5 a, cy a+(saddr)+cy a, !addr16 3 8 9 a, cy a+(addr16)+cy a, [hl] 1 4 5 a, cy a+(hl)+cy a, [hl+byte] 2 8 9 a, cy a+(hl+byte)+cy a, [hl+b] 2 8 9 a, cy a+(hl+b)+cy a, [hl+c] 2 8 9 a, cy a+(hl+c)+cy notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. 3. only when rp = bc, de, or hl 4. except r = a remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag 16-bit data transfer 8-bit operation
chapter 20 instruction set 388 user? manual u11302ej4v0um instruc- mnemonic operands bytes operation tion group sub a, #byte 2 4 a, cy a?yte saddr, #byte 3 6 8 (saddr), cy (saddr)?yte a, r note 3 2 4 a, cy a? r, a 2 4 r, cy r? a, saddr 2 4 5 a, cy a?saddr) a, !addr16 3 8 9 a, cy a?addr16) a, [hl] 1 4 5 a, cy a?hl) a, [hl+byte] 2 8 9 a, cy a?hl+byte) a, [hl+b] 2 8 9 a, cy a?hl+b) a, [hl+c] 2 8 9 a, cy a?hl+c) subc a, #byte 2 4 a, cy a?yte?y saddr, #byte 3 6 8 (saddr), cy (saddr)?yte?y a, r note 3 2 4 a, cy a??y r, a 2 4 r, cy r??y a, saddr 2 4 5 a, cy a?saddr)?y a, !addr16 3 8 9 a, cy a?addr16)?y a, [hl] 1 4 5 a, cy a?hl)?y a, [hl+byte] 2 8 9 a, cy a?hl+byte)?y a, [hl+b] 2 8 9 a, cy a?hl+b)?y a, [hl+c] 2 8 9 a, cy a?hl+c)?y and a, #byte 2 4 a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 24 a a r r, a 2 4 r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a (hl) a, [hl+byte] 2 8 9 a a (hl+byte) a, [hl+b] 2 8 9 a a (hl+b) a, [hl+c] 2 8 9 a a (hl+c) notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. 3. except r = a remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag 8-bit operation
chapter 20 instruction set 389 user? manual u11302ej4v0um instruc- mnemonic operands bytes operation tion group or a, #byte 2 4 a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 24 a a r r, a 2 4 r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a (hl) a, [hl+byte] 2 8 9 a a (hl+byte) a, [hl+b] 2 8 9 a a (hl+b) a, [hl+c] 2 8 9 a a (hl+c) xor a, #byte 2 4 a a byte saddr, #byte 3 6 8 (saddr) (saddr) byte a, r note 3 24 a a r r, a 2 4 r r a a, saddr 2 4 5 a a (saddr) a, !addr16 3 8 9 a a (addr16) a, [hl] 1 4 5 a a (hl) a, [hl+byte] 2 8 9 a a (hl+byte) a, [hl+b] 2 8 9 a a (hl+b) a, [hl+c] 2 8 9 a a (hl+c) cmp a, #byte 2 4 a?yte saddr, #byte 3 6 8 (saddr)?yte a, r note 3 2 4 a? r, a 2 4 r? a, saddr 2 4 5 a?saddr) a, !addr16 3 8 9 a?addr16) a, [hl] 1 4 5 a?hl) a, [hl+byte] 2 8 9 a?hl+byte) a, [hl+b] 2 8 9 a?hl+b) a, [hl+c] 2 8 9 a?hl+c) notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. 3. except r = a remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag 8-bit operation
chapter 20 instruction set 390 user? manual u11302ej4v0um ror4 [hl] 2 10 12 rol4 [hl] 2 10 12 instruc- mnemonic operands bytes operation tion group addw ax, #word 3 6 ax, cy ax+word subw ax, #word 3 6 ax, cy ax?ord cmpw ax, #word 3 6 ax?ord mulu x 2 16 ax a x divuw c 2 25 ax (quotient), c (remainder) ax c r12r r+1 saddr 2 4 6 (saddr) (saddr)+1 r12r r? saddr 2 4 6 (saddr) (saddr)? incw rp 1 4 rp rp+1 decw rp 1 4 rp rp? rotation ror a, 1 1 2 (cy, a 7 a 0 , a m? a m ) 1 rol a, 1 1 2 (cy, a 0 a 7 , a m+1 a m ) 1 rorc a, 1 1 2 (cy a 0 , a 7 cy, a m? a m ) 1 rolc a, 1 1 2 (cy a 7 , a 0 cy, a m+1 a m ) 1 a 3? (hl) 3? , (hl) 7? a 3? , (hl) 3? (hl) 7? a 3? (hl) 7? , (hl) 3? a 3? , (hl) 7? (hl) 3? decimal adjust accumulator after addition decimal adjust accumulator after subtract cy, saddr.bit 3 6 7 cy (saddr.bit) cy, sfr.bit 3 7 cy sfr.bit cy, a.bit 2 4 cy a.bit cy, psw.bit 3 7 cy psw.bit cy, [hl].bit 2 6 7 cy (hl).bit saddr.bit, cy 3 6 8 (saddr.bit) cy sfr.bit, cy 3 8 sfr.bit cy a.bit, cy 2 4 a.bit cy psw.bit, cy 3 8 psw.bit cy [hl].bit, cy 2 6 8 (hl).bit cy notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag 16-bit operation multiply/ divide inc dec increase/ decrease adjba 2 4 adjbs 2 4 bcd adjust mov1 bit manipu- lation
chapter 20 instruction set 391 user? manual u11302ej4v0um zaccy instruc- mnemonic operands bytes operation tion group and1 cy, saddr.bit 3 6 7 cy cy (saddr.bit) cy, sfr.bit 3 7 cy cy sfr.bit cy, a.bit 2 4 cy cy a.bit cy, psw.bit 3 7 cy cy psw.bit cy, [hl].bit 2 6 7 cy cy (hl).bit or1 cy, saddr.bit 3 6 7 cy cy (saddr.bit) cy, sfr.bit 3 7 cy cy sfr.bit cy, a.bit 2 4 cy cy a.bit cy, psw.bit 3 7 cy cy psw.bit cy, [hl].bit 2 6 7 cy cy (hl).bit xor1 cy, saddr.bit 3 6 7 cy cy (saddr.bit) cy, sfr.bit 3 7 cy cy sfr.bit cy, a.bit 2 4 cy cy a.bit cy, psw.bit 3 7 cy cy psw.bit cy, [hl].bit 2 6 7 cy cy (hl).bit set1 saddr.bit 2 4 6 (saddr.bit) 1 sfr.bit 3 8 sfr.bit 1 a.bit 2 4 a.bit 1 psw.bit 2 6 psw.bit 1 [hl].bit 2 6 8 (hl).bit 1 clr1 saddr.bit 2 4 6 (saddr.bit) 0 sfr.bit 3 8 sfr.bit 0 a.bit 2 4 a.bit 0 psw.bit 2 6 psw.bit 0 [hl].bit 2 6 8 (hl).bit 0 set1 cy 1 2 cy 11 clr1 cy 1 2 cy 00 not1 cy 1 2 cy cy notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). note 2 note 1 clocks flag bit manipu- lation
chapter 20 instruction set 392 user? manual u11302ej4v0um instruc- mnemonic operands bytes operation tion group call !addr16 3 7 (sp?) (pc+3) h , (sp?) (pc+3) l , pc addr16, sp sp? callf !addr11 2 5 (sp?) (pc+2) h , (sp?) (pc+2) l , pc 15?1 00001, pc 10? addr11, sp sp? callt [addr5] 1 6 (sp?) (pc+1) h , (sp?) (pc+1) l , pc h (00000000, addr5+1), pc l (00000000, addr5), sp sp? brk 1 6 (sp?) psw, (sp?) (pc+1) h , (sp?) (pc+1) l , pc h (003fh), pc l (003eh), sp sp?, ie 0 ret 1 6 pc h (sp+1), pc l (sp), sp sp+2 reti 1 6 pc h (sp+1), pc l (sp), r r r psw (sp+2), sp sp+3, nmis 0 retb 1 6 pc h (sp+1), pc l (sp), r r r psw (sp+2), sp sp+3 push psw 1 2 (sp?) psw, sp sp? rp 1 4 (sp?) rp h , (sp?) rp l , sp sp? pop psw 1 2 psw (sp), sp sp+1 r r r rp 1 4 rp h (sp+1), rp l (sp), sp sp+2 movw sp, #word 4 10 sp word sp, ax 2 8 sp ax ax, sp 2 8 ax sp br !addr16 3 6 pc addr16 $addr16 2 6 pc pc + 2 + jdisp8 ax 2 8 pc h a, pc l x bc $addr16 2 6 pc pc + 2 + jdisp8 if cy = 1 bnc $addr16 2 6 pc pc + 2 + jdisp8 if cy = 0 bz $addr16 2 6 pc pc + 2 + jdisp8 if z = 1 bnz $addr16 2 6 pc pc + 2 + jdisp8 if z = 0 notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag call return stack manipu- lation uncondi- tional branch condi- tional branch
chapter 20 instruction set 393 user? manual u11302ej4v0um instruc- mnemonic operands bytes operation tion group bt saddr.bit, $addr16 3 8 9 pc pc+3+jdisp8 if (saddr.bit) = 1 sfr.bit, $addr16 4 11 pc pc+4+jdisp8 if sfr.bit = 1 a.bit, $addr16 3 8 pc pc+3+jdisp8 if a.bit = 1 psw.bit, $addr16 3 9 pc pc+3+jdisp8 if psw.bit = 1 [hl].bit, $addr16 3 10 11 pc pc+3+jdisp8 if (hl).bit = 1 bf saddr.bit, $addr16 4 10 11 pc pc+4+jdisp8 if (saddr.bit) = 0 sfr.bit, $addr16 4 11 pc pc+4+jdisp8 if sfr.bit = 0 a.bit, $addr16 3 8 pc pc+3+jdisp8 if a.bit = 0 psw.bit, $addr16 4 11 pc pc+4+jdisp8 if psw.bit = 0 [hl].bit, $addr16 3 10 11 pc pc+3+jdisp8 if (hl).bit = 0 btclr saddr.bit, $addr16 4 10 12 pc pc+4+jdisp8 if (saddr.bit) = 1 then reset (saddr.bit) sfr.bit, $addr16 4 12 pc pc+4+jdisp8 if sfr.bit = 1 then reset sfr.bit a.bit, $addr16 3 8 pc pc+3+jdisp8 if a.bit = 1 then reset a.bit psw.bit, $addr16 4 12 pc pc+4+jdisp8 if psw.bit = 1 then reset psw.bit [hl].bit, $addr16 3 10 12 pc pc+3+jdisp8 if (hl).bit = 1 then reset (hl).bit dbnz b, $addr16 2 6 b b?, then pc pc+2+jdisp8 if b 0 c, $addr16 2 6 c c?, then pc pc+2+jdisp8 if c 0 saddr, $addr16 3 8 10 (saddr) (saddr)?, then pc pc+3+jdisp8 if (saddr) 0 sel rbn 2 4 rbs1, 0 n nop 1 2 no operation ei 2 6 ie 1 (enable interrupt) di 2 6 ie 0 (disable interrupt) halt 2 6 set halt mode stop 2 6 set stop mode notes 1. when the internal high-speed ram area is accessed or an instruction with no data access. 2. when an area except the internal high-speed ram area is accessed. remark one instruction clock cycle is one cycle of the cpu clock (f cpu ) selected by the processor clock control register (pcc). zaccy note 2 note 1 clocks flag cpu control condi- tional branch
chapter 20 instruction set 394 user? manual u11302ej4v0um 20.3 instructions listed by addressing type (1) 8-bit instructions mov, xch, add, addc, sub, subc, and, or, xor, cmp, mulu, divuw, inc, dec, ror, rol, rorc, rolc, ror4, rol4, push, pop, dbnz
chapter 20 instruction set 395 user? manual u11302ej4v0um second operand first operand #byte a r note sfr saddr !addr16 psw [de] [hl] [hl+byte] $addr16 1 none [hl+b] [hl+c] a add mov mov mov mov mov mov mov mov ror addc xch xch xch xch xch xch xch rol sub add add add add add rorc subc addc addc addc addc addc rolc and sub sub sub sub sub or subc subc subc subc subc xor and and and and and cmp or or or or or xor xor xor xor xor cmp cmp cmp cmp cmp r mov mov inc add dec addc sub subc and or xor cmp b, c dbnz sfr mov mov saddr mov mov dbnz inc add dec addc sub subc and or xor cmp !addr16 mov psw mov mov push pop [de] mov [hl] mov ror4 rol4 [hl+byte] mov [hl+b] [hl+c] x mulu c divuw note except r = a
chapter 20 instruction set 396 user? manual u11302ej4v0um (2) 16-bit instructions movw, xchw, addw, subw, cmpw, push, pop, incw, decw second operand #word ax rp note sfrp saddrp !addr16 sp none ax addw movw movw movw movw movw subw xchw cmpw rp movw movw note incw decw push pop sfrp movw movw saddrp movw movw !addr16 movw sp movw movw note only when rp = bc, de, or hl (3) bit manipulation instructions mov1, and1, or1, xor1, set1, clr1, not1, bt, bf, btclr second operand a.bit sfr.bit saddr.bit psw.bit [hl].bit cy $addr16 none a.bit mov1 bt set1 bf clr1 btclr sfr.bit mov1 bt set1 bf clr1 btclr saddr.bit mov1 bt set1 bf clr1 btclr psw.bit mov1 bt set1 bf clr1 btclr [hl].bit mov1 bt set1 bf clr1 btclr cy mov1 mov1 mov1 mov1 mov1 set1 and1 and1 and1 and1 and1 clr1 or1 or1 or1 or1 or1 not1 xor1 xor1 xor1 xor1 xor1 first operand first operand
chapter 20 instruction set 397 user? manual u11302ej4v0um (4) call instructions/branch instructions call, callf, callt, br, bc, bnc, bz, bnz, bt, bf, btclr, dbnz second operand ax !addr16 !addr11 [addr5] $addr16 basic instruction br call callf callt br br bc bnc bz bnz compound instruction bt bf btclr dbnz (5) other instructions adjba, adjbs, brk, ret, reti, retb, sel, nop, ei, di, halt, stop first operand
398 user? manual u11302ej4v0um appendix a differences between pd78044h, 780228, and 780208 subseries table a-1 shows the major differences between the pd78044h, 780228, and 780208 subseries. table a-1. major differences between pd78044h, 780228, and 780208 subseries part number pd78044h subseries pd780228 subseries pd780208 subseries item prom or flash memory version pd78p048b pd78f0228 pd78p0208 (prom) (flash memory) (prom) supply voltage v dd = 2.7 to 5.5 v v dd = 4.5 to 5.5 v v dd = 2.7 to 5.5 v internal rom size pd78044h: 32 kb pd780226: 48 kb pd780204: 32 kb pd78045h: 40 kb pd780228: 60 kb pd780204a: 32 kb pd78046h: 48 kb pd78f0228: 60 kb pd780205: 40 kb pd78p048b: 60 kb pd780205a: 40 kb pd780206: 48 kb pd780208: 60 kb pd78p0208: 60 kb internal expansion ram size pd78p048b only: 1024 bytes 512 bytes pd780206, 780208, and 78p0208 only: 1024 bytes internal buffer ram size pd78p048b only: 64 bytes none 64 bytes vfd display ram size 48 bytes 96 bytes 80 bytes cpu clock main system clock or main system clock only main system clock or subsystem clock selectable subsystem clock selectable i/o ports 68 pins 72 pins 74 pins total of vfd display output pins 34 pins 48 pins 53 pins serial interface 1 channel 2 channels timer 16-bit timer/event counter: 8-bit remote control timer: 16-bit timer/event counter: 1 channel 1 channel 1 channel 8-bit timer/event counter: 8-bit pwm timer: 2 channels 8-bit timer/event counter: 2 channels watchdog timer: 1 channel 2 channels watch timer: 1 channel watch timer: 1 channel watchdog timer: 1 channel watchdog timer: 1 channel clock output provided none provided buzzer output provided none provided vectored interrupt internal 10 8 11 source external 4 4 4 test input provided none provided package 80-pin plastic qfp 100-pin plastic qfp 100-pin plastic qfp (14 20) (14 20) (14 20) electrical specifications and refer to individual data sheet. recommended soldering conditions remark in addition to the above items, the configuration of the development tools also differs between the above subseries (especially between the prom and flash memory versions). for details, refer to the user? manual of each subseries.
399 user? manual u11302ej4v0um appendix b development tools the following development tools are available for the development of systems which employ the pd780208 subseries. figure b-1 shows the configuration of the development tools. support for pc98-nx series unless otherwise specified, products supported by ibm pc/at tm compatible machines can be used for pc98- nx series computers. when using pc98-nx series computers, refer to the description for ibm pc/at compatible machines. windows unless otherwise specified, ?indows?means the following oss. windows 3.1 windows 95 windows 98 windows 2000 windows nt tm ver. 4.0
appendix b development tools 400 user? manual u11302ej4v0um figure b-1. configuration of development tools notes 1. the c library source file is not included in the software package. 2. the project manager is included in the assembler package. the project manager is only used for windows. language processing software assembler package c compiler package device file c library source file note 1 debugging software integrated debugger system simulator host machine (pc or ews) interface adapter, pc card interface, etc. in-circuit emulator emulation board emulation probe conversion socket or conversion adapter target system prom programmer programmer adapter on-chip prom product software package project manager (windows only) note 2 software package prom write environment control software embedded software real-time os i/o board performance board power supply unit
appendix b development tools 401 user s manual u11302ej4v0um b.1 software package sp78k0 this package contains various software tools for 78k/0 series development. software package the following tools are included. ra78k0, cc78k0, id78k0-ns, sm78k0, and various device files part number: s sp78k0 remark in the part number differs depending on the os used. s sp78k0 host machine os supply medium ab17 pc-9800 series, windows (japanese version) cd-rom bb17 ibm pc/at and compatibles windows (english version) b.2 language processing software ra78k0 assembler package cc78k0 c compiler package df780208 note 1 device file cc78k0-l note 2 c library source file notes 1. the df780208 can be used in common with the ra78k0, cc78k0, sm78k0, id78k0-ns, id78k0, and rx78k0. 2. cc78k0-l is not included in the software package (sp78k0). this assembler converts programs written in mnemonics into object codes executable with a microcontroller. further, this assembler is provided with functions capable of automatically creating symbol tables and branch instruction optimization. this assembler should be used in combination with a device file (df780208) (sold separately). this assembler package is a dos-based application. it can also be used in windows, however, by using the project manager (included in assembler package) in windows. part number: s ra78k0 this compiler converts programs written in c language into object codes executable with a microcontroller. this compiler should be used in combination with an assembler package and device file (both sold separately). this c compiler package is a dos-based application. it can also be used in windows, however, by using the project manager (included in assembler package) in windows. part number: s cc78k0 this file contains information peculiar to the device. this device file should be used in combination with tools (ra78k0, cc78k0, sm78k0, id78k0-ns, id78k0, and rx78k0) (sold separately). the corresponding os and host machine differ depending on the tool used. part number: s df780208 this is a source file of functions configuring the object library included in the c compiler package. this file is required to match the object library included in c compiler package to the user s specifications. it does not depend on the operating environment because it is a source file. part number: s cc78k0-l
appendix b development tools 402 user s manual u11302ej4v0um remark in the part number differs depending on the host machine and os used. s ra78k0 s cc78k0 host machine os supply medium ab13 pc-9800 series, windows (japanese version) 3.5-inch 2hd fd bb13 ibm pc/at and compatibles windows (english version) ab17 windows (japanese version) cd-rom bb17 windows (english version) 3p17 hp9000 series 700 tm hp-ux tm (rel. 10.10) 3k17 sparcstation tm sunos tm (rel. 4.1.4), solaris tm (rel. 2.5.1) s df780208 s cc78k0-l host machine os supply medium ab13 pc-9800 series, windows (japanese version) 3.5-inch 2hd fd bb13 ibm pc/at and compatibles windows (english version) 3p16 hp9000 series 700 hp-ux (rel. 10.10) dat 3k13 sparcstation sunos (rel. 4.1.4), 3.5-inch 2hd fd 3k15 solaris (rel. 2.5.1) 1/4-inch cgmt b.3 control software project manager this is control software designed to enable efficient user program development in the windows environment. all operations used in development of a user program, such as starting the editor, building, and starting the debugger, can be performed from the project manager. the project manager is included in the assembler package (ra78k0). it can only be used in windows.
appendix b development tools 403 user s manual u11302ej4v0um b.4 prom programming tools b.4.1 hardware pg-1500 this prom programmer allows users to encode the prom in single-chip microcontrollers prom programmer stand-alone or using a host machine. this requires connection of the accompanying board and separately-sold prom programmer adapter to the prom programmer. besides internal proms, general discrete prom devices whose capacities range from 256 kb to 4 mb can be programmed. pa-78p0208gf this prom programmer adapter is for the pd78p0208 and should be connected to the prom programmer adapter pg-1500. this adapter is for a 100-pin plastic qfp (gf-3ba type). b.4.2 software pg-1500 controller this software allows users to control the pg-1500 from a host machine which is connected to the pg-1500 via serial/parallel interface cable(s). part number: s pg1500 remark in the part number differs depending on the host machine and os used. s pg1500 host machine os supply medium 5a13 pc-9800 series ms-dos 3.5-inch 2hd 5a10 (ver. 3.30 to ver. 6.2 note 1 ) 5-inch 2hd 7b13 ibm pc/at and compatibles note 2 3.5-inch 2hd 7b10 5-inch 2hc notes 1. although a task swap function is incorporated in ms-dos ver. 5.0 or later, this function cannot be used with the above software. 2. the following oss for ibm pcs are supported (ver. 5.0 or later of ms- dos has a task swap function, but this function cannot be used with the above software). os version pc dos ver.5.02 to ver.6.3 j6.1/v to j6.3/v (only the english version is supported.) ms-dos ver.5.0 to ver.6.22 5.0/v to 6.2/v (only the english version is supported.) ibm dos tm j5.02/v (only the english version is supported.)
appendix b development tools 404 user? manual u11302ej4v0um b.5 debugging tools (hardware) b.5.1 when using in-circuit emulator ie-78k0-ns, ie-78k0-ns-a ie-78k0-ns in-circuit emulator ie-78k0-ns-pa performance board ie-78k0-ns-a in-circuit emulator ie-70000-mc-ps-b power supply unit ie-70000-98-if-c interface adapter ie-70000-cd-if-a pc card interface ie-70000-pc-if-c interface adapter ie-70000-pci-if-a interface adapter ie-780208-ns-em1 emulation board np-100gf-tq np-h100gf-tq emulation probe tgf-100rbp conversion adapter np-100gf emulation probe ev-9200gf-100 conversion socket (see figures b-2 and b-3 ) remarks 1. np-100gf, np-100gf-tq, and np-h100gf-tq are products of naito densei machida mfg. co., ltd. contact: naito densei machida mfg. co., ltd. +81-45-475-4191 2. tgf-100rbp is a product of tokyo eletech corporation. inquiry: daimaru kogyo, ltd. phone: tokyo electronics dept. +81-3-3820-7112 osaka electronics 2nd dept. +81-6-6244-6672 3. the ev-9200gf-100 is sold in a set of five units. 4. the tgf-100rbp is sold in single units. the in-circuit emulator serves to debug hardware and software when developing application systems using a 78k/0 series product. it can be used with an integrated debugger (id78k0-ns). this emulator should be used in combination with a power supply unit, emulation probe, and interface adapter, which is required to connect this emulator to the host machine. this board is used for extending the ie-78k0-ns functions. with the addition of this board, the addition of a coverage function, enhancement of tracer and timer functions, and other such debugging function enhancements are possible. in-circuit emulator that combines the ie-78k0-ns and ie-78k0-ns-pa this adapter is used for supplying power from a 100 to 240 v ac outlet. this adapter is required when using a pc-9800 series computer (except notebook type) as the ie-78k0-ns host machine (c bus compatible). this is the pc card and interface cable required when using a notebook-type computer as the ie-78k0-ns host machine (pcmcia socket compatible). this adapter is required when using an ibm pc/at compatible computer as the ie-78k0- ns host machine (isa bus compatible). this adapter is required when using a pc with a pci bus as the ie-78k0-ns host machine. this board emulates the operations of the peripheral hardware peculiar to a device. it should be used in combination with an in-circuit emulator. this probe is used to connect the in-circuit emulator to the target system and is designed for a 100-pin plastic qfp (gf-3ba type). it should be used in combination with the tgf- 100rbp. this conversion socket connects the np-100gf-tq or np-h100gf-tq to the target system board designed to mount a 100-pin plastic qfp (gf-3ba type). this probe is used to connect the in-circuit emulator to the target system and is designed for a 100-pin plastic qfp (gf-3ba type). this conversion socket connects the np-100gf to the target system board designed to mount a 100-pin plastic qfp (gf-3ba type).
appendix b development tools 405 user s manual u11302ej4v0um b.5.2 when using in-circuit emulator ie-78001-r-a ie-78001-r-a in-circuit emulator ie-70000-98-if-c interface adapter ie-70000-pc-if-c interface adapter ie-780208-r-em emulation board ep-78064gf-r emulation probe ev-9200gf-100 conversion socket (see figures b-2 and b-3 ) remark the ev-9200gf-100 is sold in a set of five units. this is an in-circuit emulator for debugging the hardware and software when an application system using the 78k/0 series is developed. it can be used with an integrated debugger (id78k0). this emulator is used with an emulation probe and interface adapter for connecting a host machine. this adapter is necessary when a pc-9800 series pc (except notebook type) is used as the host machine for the ie-78001-r-a (c bus compatible). this adapter is necessary when an ibm pc/at or compatible machine is used as the host machine for the ie-78001-r-a (isa bus compatible). this board is used with an in-circuit emulator to emulate device-specific peripheral hardware. this probe is for a 100-pin plastic qfp (gf-3ba type) and connects an in-circuit emulator and the target system. this conversion socket connects the board of the target system created to mount a 100-pin plastic qfp (gf-3ba type) and ep-78064gf-r.
appendix b development tools 406 user s manual u11302ej4v0um b.6 debugging tools (software) sm78k0 this is a system simulator for the 78k/0 series. the sm78k0 is windows-based system simulator software. it is used to perform debugging at the c source level or assembler level while simulating the operation of the target system on a host machine. use of the sm78k0 allows the execution of application logical testing and performance testing on an independent basis from hardware development, thereby providing higher development efficiency and software quality. the sm78k0 should be used in combination with a device file (df780208) (sold separately). part number: s sm78k0 id78k0-ns this debugger supports the in-circuit emulators for the 78k/0 series. the integrated debugger id78k0-ns is windows-based software. (supporting in-circuit emulators it has improved c-compatible debugging functions and can display the results of ie-78k0-ns and ie-78k0-ns-a) tracing with the source program using an integrating window function that associates id78k0 the source program, disassemble display, and memory display with the trace result. integrated debugger it should be used in combination with a device file (sold separately). (supporting in-circuit emulator part number: s id78k0-ns ie-78001-r-a) s id78k0 remark in the part number differs depending on the host machine and os used. s sm78k0 s id78k0-ns s id78k0 host machine os supply medium ab13 pc-9800 series, windows (japanese version) 3.5-inch 2hd fd bb13 ibm pc/at and compatibles windows (english version) ab17 windows (japanese version) cd-rom bb17 windows (english version)
appendix b development tools 407 user s manual u11302ej4v0um b.7 embedded software rx78k0 the rx78k0 is a real-time os conforming to the itron specifications. real-time os a tool (configurator) for generating the nucleus of the rx78k0 and multiple information tables is supplied. used in combination with an assembler package (ra78k0) and device file (df780208) (both sold separately). the real-time os is a dos-based application. it should be used in the dos prompt when using in windows. part number: s rx78013- ???? caution when purchasing the rx78k0, fill in the purchase application form in advance and sign the user agreement. remark and ???? in the part number differ depending on the host machine and os used. s rx78013- ???? ???? product outline maximum number for use in mass production 001 evaluation object do not use for mass-produced product. 100k mass-production object 0.1 million units 001m 1 million units 010m 10 million units s01 source program source program for mass-produced object host machine os supply medium aa13 pc-9800 series windows (japanese version) 3.5-inch 2hd fd ab13 ibm pc/at and compatibles windows (japanese version) bb13 windows (english version)
appendix b development tools 408 user? manual u11302ej4v0um b.8 method for upgrading from former in-circuit emulator for 78k/0 series to ie-78001-r-a if you already have a former in-circuit emulator for 78k/0 series microcontrollers (ie-78000-r or ie-78000-r-a), that in-circuit emulator can operate as an equivalent to the ie-78001-r-a by replacing its internal break board with the ie-78001-r-bk. table b-1. method for upgrading from former in-circuit emulator for 78k/0 series to ie-78001-r-a in-circuit emulator owned in-circuit emulator cabinet system-up note board to be purchased ie-78000-r required ie-78001-r-bk ie-78000-r-a not required note for upgrading a cabinet, send your in-circuit emulator to nec electronics.
appendix b development tools 409 user s manual u11302ej4v0um ev-9200gf-100 a d e b f 1 no.1 pin index m n o l k s r q i h g p c j ev-9200gf-100-g0 item millimeters inches a b c d e f g h i j k l m n o p q r s 24.6 21 15 18.6 4-c 2 0.8 12.0 22.6 25.3 6.0 16.6 19.3 8.2 8.0 2.5 2.0 0.35 2.3 1.5 0.969 0.827 0.591 0.732 4-c 0.079 0.031 0.472 0.89 0.996 0.236 0.654 076 0.323 0.315 0.098 0.079 0.014 0.091 0.059 b.9 conversion socket (ev-9200gf-100) package drawing and recommended footprint figure b-2. ev-9200gf-100 package drawing (for reference purposes only)
appendix b development tools 410 user s manual u11302ej4v0um f h e d a b c i j k l 0.026 0.026 ev-9200gf-100-p1 item millimeters inches a b c d e f g h i j k l 26.3 21.6 15.6 20.3 12 0.05 6 0.05 0.35 0.02 2.36 0.03 2.3 1.57 0.03 1.035 0.85 0.614 0.799 0.472 0.236 0.014 0.093 0.091 0.062 0.65 0.02 29=18.85 0.05 0.65 0.02 19=12.35 0.05 +0.001 0.002 +0.002 _ 0.002 +0.001 0.002 +0.003 _ 0.002 +0.003 _ 0.002 +0.003 _ 0.002 +0.001 _ 0.001 +0.001 _ 0.002 +0.001 _ 0.002 g 1.142=0.742 0.748=0.486 figure b-3. recommended footprint for ev-9200gf-100 (for reference purposes only) caution the dimensions of the mount pad for ev-9200 and that for target device (qfp) may be different in some parts. for the recommended mount pad dimensions for qfp, refer to the semiconductor device mount manual website (http://www.necel.com/pkg/en/mount/index.html).
appendix b development tools 411 user s manual u11302ej4v0um b.10 notes on target system design the following shows the conditions when connecting the emulation probe to the conversion adapter. follow the configuration below and consider the shape of parts to be mounted on the target system when designing a system. among the products described in this appendix, the np-100gf-tq and np-h100gf-tq are products of naito densei machida mfg. co., ltd., and the tgf-100rbp is a product of tokyo eletech corporation. table b-2. distance between ie system and conversion adapter emulation probe conversion adapter distance between ie system and conversion adapter np-100gf-tq tgf-100rbp 170 mm np-h100gf-tq 370 mm figure b-4. distance between ie system and conversion adapter note distance when the np-100gf-tq is used. when the np-h100gf-tq is used, the distance is 370 mm. 170 mm note in-circuit emulator ie-78k0-ns or ie-78k0-ns-a emulation board ie-780208-ns-em1 conversion adapter: tgf-100rbp target system cn6 emulation probe np-100gf-tq, np-h100gf-tq
appendix b development tools 412 user s manual u11302ej4v0um figure b-5. connection conditions of target system (when np-100gf-tq is used) figure b-6. connection conditions of target system (when np-h100gf-tq is used) emulation probe np-h100gf-tq emulation board ie-780208-ns-em1 42 mm 45 mm target system 11 mm conversion adapter tgf-100rbp 27.5 mm pin 1 21 mm emulation probe np-100gf-tq 40 mm 34 mm target system conversion adapter tgf-100rbp 27.5 mm pin 1 11 mm emulation board ie-780208-ns-em1 21 mm
413 user? manual u11302ej4v0um appendix c register index c.1 register index (by register name) [a] a/d conversion result register (adcr) ... 192 a/d converter input select register (adis) ... 196 a/d converter mode register (adm) ... 194 automatic data transmit/receive address pointer (adtp) ... 259 automatic data transmit/receive control register (adtc) ... 263, 274 automatic data transmit/receive interval specification register (adti) ... 265, 275 [d] display mode register 0 (dspm0) ... 104, 303 display mode register 1 (dspm1) ... 107, 303 display mode register 2 (dspm2) ... 304 [e] 8-bit compare register (cr10, cr20) ... 153 8-bit timer mode control register (tmc1) ... 155 8-bit timer output control register (toc1) ... 156 8-bit timer register 1 (tm1) ... 153 8-bit timer register 2 (tm2) ... 153 external interrupt mode register (intm0) ... 133, 343 [ i ] internal expansion ram size switching register (ixs) ... 374 internal memory size switching register (ims) ... 372 interrupt mask flag register 0h (mk0h) ... 341, 358 interrupt mask flag register 0l (mk0l) ... 341 interrupt request flag register 0h (if0h) ... 340, 358 interrupt request flag register 0l (if0l) ... 340 interrupt timing specification register (sint) ... 216, 235, 252 [o] oscillation stabilization time select register (osts) ... 360 [p] port 0 (p0) ... 83 port 1 (p1) ... 85 port 2 (p2) ... 86 port 3 (p3) ... 88 port 7 (p7) ... 89 port 8 (p8) ... 90 port 9 (p9) ... 91 port 10 (p10) ... 92
appendix c register index 414 user? manual u11302ej4v0um port 11 (p11) ... 93 port 12 (p12) ... 94 port mode register 0 (pm0) ... 95 port mode register 1 (pm1) ... 95 port mode register 2 (pm2) ... 95 port mode register 3 (pm3) ... 95, 132, 157, 185, 189 port mode register 7 (pm7) ... 95 port mode register 10 (pm10) ... 95 port mode register 11 (pm11) ... 95 port mode register 12 (pm12) ... 95 priority specification flag register 0h (pr0h) ... 342 priority specification flag register 0l (pr0l) ... 342 processor clock control register (pcc) ... 102 program status word (psw) ... 60, 346 pull-up resistor option register (puo) ... 97 [s] sampling clock select register (scs) ... 134, 344 serial bus interface control register (sbic) ... 214, 220, 233, 251 serial i/o shift register 0 (sio0) ... 209 serial i/o shift register 1 (sio1) ... 259 serial operating mode register 0 (csim0) ... 211, 218, 232, 250 serial operating mode register 1 (csim1) ... 262, 269, 273 16-bit capture register (cr01) ... 126 16-bit compare register (cr00) ... 126 16-bit timer mode control register (tmc0) ... 129 16-bit timer output control register (toc0) ... 131 16-bit timer register (tm0) ... 126 16-bit timer register (tms) ... 153 slave address register (sva) ... 209 [t] timer clock select register 0 (tcl0) ... 127, 183 timer clock select register 1 (tcl1) ... 153 timer clock select register 2 (tcl2) ... 169, 177, 187 timer clock select register 3 (tcl3) ... 211, 261 [w] watch timer mode control register (tmc2) ... 172 watchdog timer mode register (wdtm) ... 179
appendix c register index 415 user? manual u11302ej4v0um c.2 register index (by register symbol) [a] adcr: a/d conversion result register ... 192 adis: a/d converter input select register ... 196 adm: a/d converter mode register ... 194 adtc: automatic data transmit/receive control register ... 263, 274 adti: automatic data transmit/receive interval specification register ... 265, 275 adtp: automatic data transmit/receive address pointer ... 259 [c] cr00: 16-bit compare register ... 126 cr01: 16-bit capture register ... 126 cr10: 8-bit compare register ... 153 cr20: 8-bit compare register ... 153 csim0: serial operating mode register 0 ... 211, 218, 232, 250 csim1: serial operating mode register 1 ... 262, 269, 273 [d] dspm0: display mode register 0 ... 104, 303 dspm1: display mode register 1 ... 107, 303 dspm2: display mode register 2 ... 304 [ i ] if0h: interrupt request flag register 0h ... 340, 358 if0l: interrupt request flag register 0l ... 340 ims: internal memory size switching register ... 372 intm0: external interrupt mode register ... 133, 343 ixs: internal expansion ram size switching register ... 374 [m] mk0h: interrupt mask flag register 0h ... 341, 358 mk0l: interrupt mask flag register 0l ... 341 [o] osts: oscillation stabilization time select register ... 360 [p] p0: port 0 ... 83 p1: port 1 ... 85 p2: port 2 ... 86 p3: port 3 ... 88 p7: port 7 ... 89 p8: port 8 ... 90 p9: port 9 ... 91 p10: port 10 ... 92 p11: port 11 ... 93 p12: port 12 ... 94
appendix c register index 416 user? manual u11302ej4v0um pcc: processor clock control register ... 102 pm0: port mode register 0 ... 95 pm1: port mode register 1 ... 95 pm2: port mode register 2 ... 95 pm3: port mode register 3 ... 95, 132, 157, 185, 189 pm7: port mode register 7 ... 95 pm10: port mode register 10 ... 95 pm11: port mode register 11 ... 95 pm12: port mode register 12 ... 95 pr0h: priority specification flag register 0h ... 342 pr0l: priority specification flag register 0l ... 342 psw: program status word ... 60, 346 puo: pull-up resistor option register ... 97 [s] sbic: serial bus interface control register ... 214, 220, 233, 251 scs: sampling clock select register ... 134, 344 sint: interrupt timing specification register ... 216, 235, 252 sio0: serial i/o shift register 0 ... 209 sio1: serial i/o shift register 1 ... 259 sva: slave address register ... 209 [t] tcl0: timer clock select register 0 ... 127, 183 tcl1: timer clock select register 1 ... 153 tcl2: timer clock select register 2 ... 169, 177, 187 tcl3: timer clock select register 3 ... 211, 261 tm0: 16-bit timer register ... 126 tm1: 8-bit timer register 1 ... 153 tm2: 8-bit timer register 2 ... 153 tmc0: 16-bit timer mode control register ... 129 tmc1: 8-bit timer mode control register ... 155 tmc2: watch timer mode control register ... 172 tms: 16-bit timer register ... 153 toc0: 16-bit timer output control register ... 131 toc1: 8-bit timer output control register ... 156 [w] wdtm: watchdog timer mode register ... 179
417 user? manual u11302ej4v0um appendix d revision history here is the revision history of this manual. the ?pplied to:?column indicates the chapters of each edition in which the revision was applied. (1/2) edition revisions from previous edition applied to: second ?the following products are already developed: pd780204gf- -3ba, throughout pd780205gf- -3ba, pd78p0208gf- -3ba, pd78p0208kl-t ?addition of the pd780206 and 780208 change the power supply voltage values in 1.1 features and 1.7 function chapter 1 outline outline addition of the pd78018f, 78018fy, 78078, 78078y, 78083, and 780208 subseries on 1.5 78k/0 series expansion addition of caution about the condition of input leak current in 4.2.5 port 7 chapter 4 port functions addition of note on table 4-3 port mode register and output latch setting when alternate function is used addition of 1/2 frequency divider on figure 5-1 clock generator block chapter 5 diagram clock generator addition of note and caution on figure 9-3 watchdog timer mode register chapter 9 format watchdog timer deletion of chapter 10 6-bit up/down counter chapter 10 6-bit up/down counter addition of caution when using standby function on figure 12-2 a/d chapter 12 converter mode register format a/d converter addition of figure 12-11 av dd pin connection addition of caution on 14.4.3 (3) (d) busy control option chapter 14 serial interface channel 1 correction of appendix a development tools appendix a development tools third the following products are already developed: pd780206gf- -3ba, throughout pd780208gf- -3ba addition of quality grade chapter 1 outline correction of block diagrams of ports 2, 3, and 10 to 12 chapter 4 port functions change caution when the external clock is input chapter 5 clock generator addition of caution about changing operation mode of serial interface channel 0 chapter 13 serial correction of note on bit 7 (bsye) of serial bus interface control register (sbic) interface channel 0 addition of explanation of bus release signal, command signal, address, command, data, acknowledge signal, busy signal, and ready signal to the definition of sbi addition of caution for the case that sb0 (sb1) line is changed when the sck0 line is in high level in sbi mode
appendix d revision history 418 user? manual u11302ej4v0um edition revisions from previous edition applied to: third correction of cautions when the stop mode is set chapter 17 standby function addition of appendix a differences among pd78044h, 780228, and appendix a 780208 subseries differences among pd78044h, 780228, and 780208 subseries fourth addition of the following products to target products throughout pd780204a ? pd780205a deletion of the following package from target products ? pd78p0208kl-t (100-pin ceramic wqfn) ?update of 1.6 78k/0 series lineup chapter 1 outline ?addition of note in 1.8 overview of functions ?addition of caution in table 1-1 mask options in mask rom versions ?addition of 2.2.12 v load chapter 2 ?modification of table 2-1 types of pin i/o circuits pin functions ?addition of caution in 3.1 memory space chapter 3 ?modification of note in table 3-3 special-function register list cpu architecture ?addition of caution in 4.2.6 port 8 chapter 4 ?addition of caution in 4.2.7 port 9 port functions ?addition of caution in 4.2.8 port 10 ?addition of caution in 4.2.9 port 11 ?addition of caution in 4.2.10 port 12 ?addition of note in figure 5-3 format of processor clock control register chapter 5 clock generator ?modification of caution in figure 6-8 format of external interrupt mode chapter 6 16-bit register timer/event counter modification of 6.6 (5) valid edge setting modification of caution in figure 8-2 format of timer clock select chapter 8 register 2 watch timer modification of caution in figure 9-2 format of timer clock select chapter 9 register 2 watchdog timer modification of caution in figure 11-2 format of timer clock select chapter 11 buzzer register 2 output controller addition of caution in figure 16-2 format of interrupt request flag chapter 16 register interrupt and test modification of caution in figure 16-5 format of external interrupt mode functions register addition of description in table 17-1 halt mode operating status chapter 17 addition of description in table 17-3 stop mode operating status standby function modification of table 19-2 internal memory size switching register setting chapter 19 values pd78p0208 modification of description in table a-1 major differences between appendix a pd78044h, 780228, and 780208 subseries differences between pd78044h, 780228, and 780208 subseries modification of description appendix b development tools (2/2)


▲Up To Search▲   

 
Price & Availability of UPD780208GF-XXX-3BA

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X